Skip to content

Commit 0f6e372

Browse files
committed
refactor: change from milliseconds to seconds
1 parent 56b8416 commit 0f6e372

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react-native-tracing/android/src/main/java/com/grafana/nativeinstrumentation/NativeInstrumentationModule.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ public void getStartupTime(Promise promise) {
6363
}
6464

6565
long endTime = System.currentTimeMillis();
66-
long duration = endTime - startTime;
66+
double duration = (endTime - startTime) / 1000.0;
6767

6868
android.util.Log.d(NAME, String.format(
69-
"Calculating metrics - Start: %d, End: %d, Duration: %d ms",
69+
"Calculating metrics - Start: %d, End: %d, Duration: %f seconds",
7070
startTime, endTime, duration
7171
));
7272

7373
WritableMap params = Arguments.createMap();
74-
params.putDouble("startStartupTime", startTime.doubleValue());
74+
params.putDouble("startStartupTime", (double) startTime);
7575
params.putDouble("endStartupTime", (double) endTime);
76-
params.putDouble("startupDuration", (double) duration);
76+
params.putDouble("startupDuration", duration);
7777

7878
cachedMetrics = params;
7979
android.util.Log.d(NAME, "Metrics cached and being returned");

0 commit comments

Comments
 (0)