From 497490c74e05d8ce19bbcdd5b6d904aa5f4448d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E9=A3=8E?= Date: Mon, 13 Aug 2012 10:43:14 +0800 Subject: [PATCH] starttime --- skynet-src/skynet_timer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skynet-src/skynet_timer.c b/skynet-src/skynet_timer.c index 72e0fd8c..44a5743a 100644 --- a/skynet-src/skynet_timer.c +++ b/skynet-src/skynet_timer.c @@ -234,6 +234,9 @@ skynet_timer_init(void) { TI->current = _gettime(); struct timespec ti; - clock_gettime(CLOCK_MONOTONIC, &ti); - TI->starttime = (uint32_t)(ti.tv_sec & 0xff000000); + clock_gettime(CLOCK_REALTIME, &ti); + uint32_t sec = (uint32_t)ti.tv_sec; + uint32_t mono = _gettime() / 100; + + TI->starttime = sec - mono; }