From 745eed6c4730a56f1c6ec75ed8457c0549856ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= Date: Fri, 4 Jul 2003 08:20:30 +0000 Subject: Fix For Inaccurate Elapsed Run Time, by Craigh Sather git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3809 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/settings.c b/apps/settings.c index 90775edab3..8a98010a5c 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -373,9 +373,11 @@ int settings_save( void ) { static long lasttime = 0; + int elapsed_secs; - global_settings.runtime += (current_tick - lasttime) / HZ; - lasttime = current_tick; + elapsed_secs = (current_tick - lasttime) / HZ; + global_settings.runtime += elapsed_secs; + lasttime += (elapsed_secs * HZ); if ( global_settings.runtime > global_settings.topruntime ) global_settings.topruntime = global_settings.runtime; -- cgit v1.2.3