File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
firebase-sessions/src/main/kotlin/com/google/firebase/sessions Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ internal object SessionEvents {
103
103
fun startSession (
104
104
firebaseApp : FirebaseApp ,
105
105
sessionDetails : SessionDetails ,
106
- currentTimeUs : Long = System .currentTimeMillis() * 1000
106
+ currentTimeUs : Long = WallClock .currentTimeUs(),
107
107
) =
108
108
SessionEvent (
109
109
eventType = EventType .SESSION_START ,
Original file line number Diff line number Diff line change @@ -24,4 +24,12 @@ import kotlin.time.Duration.Companion.milliseconds
24
24
internal object WallClock {
25
25
/* * Gets the [Duration] elapsed in "wall clock" time since device boot. */
26
26
fun elapsedRealtime (): Duration = SystemClock .elapsedRealtime().milliseconds
27
+
28
+ /* *
29
+ * Gets the current time in microseconds. The clock can be set by the user or phone network so it
30
+ * is not universally accurate or increasing.
31
+ */
32
+ fun currentTimeUs (): Long {
33
+ return System .currentTimeMillis() * 1000
34
+ }
27
35
}
You can’t perform that action at this time.
0 commit comments