From 7190af7c69560f9ff13f4381b2fdeef15e1c83d3 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 20 Dec 2019 08:52:38 +0900 Subject: [PATCH] Use monotonic time To measure launching time properly, we should use monotonic time. Requires: - https://review.tizen.org/gerrit/#/c/platform/core/appfw/aul-1/+/220595/ - https://review.tizen.org/gerrit/#/c/platform/core/appfw/amd/+/220598/ - https://review.tizen.org/gerrit/#/c/platform/core/appfw/launchpad/+/220600/ Change-Id: Ib4dcb78240a1f7d29001a673ca5e6d2074c02b92 Signed-off-by: Hwankyu Jhun --- src/launch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/launch.c b/src/launch.c index 98fe395..355debf 100755 --- a/src/launch.c +++ b/src/launch.c @@ -178,11 +178,11 @@ static void __clear_internal_key(bundle *kb) static inline void __set_stime(bundle *kb) { - struct timeval tv; + struct timespec start; char tmp[MAX_LOCAL_BUFSZ]; - gettimeofday(&tv, NULL); - snprintf(tmp, MAX_LOCAL_BUFSZ, "%ld/%ld", tv.tv_sec, tv.tv_usec); + clock_gettime(CLOCK_MONOTONIC, &start); + snprintf(tmp, sizeof(tmp), "%ld/%ld", start.tv_sec, start.tv_nsec); bundle_del(kb, AUL_K_STARTTIME); bundle_add(kb, AUL_K_STARTTIME, tmp); } -- 2.7.4