Skip to content

Commit

Permalink
[TIMOB-26115] Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris committed Jul 11, 2018
1 parent ebecd89 commit 55cfc96
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions iphone/Classes/TiConsole.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,25 @@ - (void)timeEnd:(id)label
[self logMessage:[logMessage componentsSeparatedByString:@" "] severity:@"warn"];
return;
}
double duration = [startTime timeIntervalSinceNow] * -1000;
NSTimeInterval duration = [startTime timeIntervalSinceNow] * -1000;
NSString *logMessage = [NSString stringWithFormat:@"%@: %0.fms", label, duration];
[self logMessage:[logMessage componentsSeparatedByString:@" "] severity:@"info"];
[_times removeObjectForKey:label];
}

- (void)timeLog:(id)args
{
NSString *label = [args objectAtIndex:0];
NSString *label = [args objectAtIndex:0] ?: @"default";
NSArray *logData = [args count] > 1 ? [args subarrayWithRange:NSMakeRange(1, [args count] - 1)] : nil;
if (label == nil) {
label = @"default";
}
NSDate *startTime = _times[label];
if (startTime == nil) {
NSString *logMessage = [NSString stringWithFormat:@"Label \"%@\" does not exist", label];
[self logMessage:[logMessage componentsSeparatedByString:@" "] severity:@"warn"];
return;
}
double duration = [startTime timeIntervalSinceNow] * -1000;
NSTimeInterval duration = [startTime timeIntervalSinceNow] * -1000;
NSString *logMessage = [NSString stringWithFormat:@"%@: %0.fms ", label, duration];
if ([logData count]) {
if ([logData count] > 0) {
logMessage = [logMessage stringByAppendingString:[logData componentsJoinedByString:@" "]];
}
[self logMessage:[logMessage componentsSeparatedByString:@" "] severity:@"info"];
Expand Down

0 comments on commit 55cfc96

Please sign in to comment.