diff --git a/Libraries/Inspector/PerformanceOverlay.js b/Libraries/Inspector/PerformanceOverlay.js index c0be51242..3329dc341 100644 --- a/Libraries/Inspector/PerformanceOverlay.js +++ b/Libraries/Inspector/PerformanceOverlay.js @@ -24,11 +24,12 @@ var PerformanceOverlay = React.createClass({ for (var key in perfLogs) { if (perfLogs[key].totalTime) { + var unit = (key === 'BundleSize') ? 'b' : 'ms'; items.push( {key} - {perfLogs[key].totalTime + 'ms'} + {perfLogs[key].totalTime + unit} ); diff --git a/React/Profiler/RCTPerfMonitor.m b/React/Profiler/RCTPerfMonitor.m index 93a6fd70a..caf660385 100644 --- a/React/Profiler/RCTPerfMonitor.m +++ b/React/Profiler/RCTPerfMonitor.m @@ -501,12 +501,13 @@ RCT_EXPORT_MODULE() - (void)loadPerformanceLoggerData { - NSMutableArray *data = [NSMutableArray new]; - NSArray *times = RCTPerformanceLoggerOutput(); NSUInteger i = 0; + NSMutableArray *data = [NSMutableArray new]; + NSArray *values = RCTPerformanceLoggerOutput(); for (NSString *label in RCTPerformanceLoggerLabels()) { - [data addObject:[NSString stringWithFormat:@"%@: %lldus", label, - [times[i+1] longLongValue] - [times[i] longLongValue]]]; + long long value = values[i+1].longLongValue - values[i].longLongValue; + NSString *unit = [label isEqualToString:@"BundleSize"] ? @"b" : @"ms"; + [data addObject:[NSString stringWithFormat:@"%@: %lld%@", label, value, unit]]; i += 2; } _perfLoggerMarks = [data copy];