From 7456343c32e2f3663e103bb56baa87656ad9eafe Mon Sep 17 00:00:00 2001 From: Zihe Jia Date: Fri, 24 Jun 2022 10:54:14 -0700 Subject: [PATCH] add millisecond precison to event tracking --- src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java b/src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java index 3b68fde8..f9dc0c80 100644 --- a/src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java +++ b/src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java @@ -2157,11 +2157,10 @@ protected void track(String eventName, JSONObject properties, boolean isAutomati // Don't allow super properties or referral properties to override these fields, // but DO allow the caller to override them in their given properties. final double timeSecondsDouble = (System.currentTimeMillis()) / 1000.0; - final long timeSeconds = (long) timeSecondsDouble; final String distinctId = getDistinctId(); final String anonymousId = getAnonymousId(); final String userId = getUserId(); - messageProps.put("time", timeSeconds); + messageProps.put("time", System.currentTimeMillis()); messageProps.put("distinct_id", distinctId); messageProps.put("$had_persisted_distinct_id", mPersistentIdentity.getHadPersistedDistinctId()); if(anonymousId != null) {