From: Hwankyu Jhun Date: Thu, 19 Dec 2019 23:52:38 +0000 (+0900) Subject: Use monotonic time X-Git-Tag: accepted/tizen/5.5/unified/20191230.212311~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7190af7c69560f9ff13f4381b2fdeef15e1c83d3;p=platform%2Fcore%2Fappfw%2Faul-1.git 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 --- 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); }