From 4800ce4635439edfe948ee884542fb3654c3845c Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 16 Jan 2018 17:48:16 +0900 Subject: [PATCH] elm genlist test - don't overflow test time nanoseconds if system slow with a long enough test or slow enough machine these do overflow so force everything to unsigned long long's for genlist test performance measuring. --- src/bin/elementary/test_genlist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/elementary/test_genlist.c b/src/bin/elementary/test_genlist.c index 7db692034a..56ae76061b 100644 --- a/src/bin/elementary/test_genlist.c +++ b/src/bin/elementary/test_genlist.c @@ -365,11 +365,11 @@ _bounce_cb(void *data) unsigned long long tll, t0ll, tdll; clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t); - t0ll = (t0.tv_sec * 1000000000) + t0.tv_nsec; - tll = (t.tv_sec * 1000000000) + t.tv_nsec; + t0ll = (((unsigned long long)t0.tv_sec) * 1000000000ULL) + t0.tv_nsec; + tll = (((unsigned long long)t.tv_sec) * 1000000000ULL) + t.tv_nsec; tdll = tll - t0ll; printf("NS since 2 = %llu , %llu frames = %llu / frame\n", - tdll, frames, tdll / (unsigned long long)frames); + tdll, frames, tdll / frames); #endif if (getenv("ELM_TEST_AUTOBOUNCE")) elm_exit(); }