summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2003-07-04 08:20:30 +0000
committerBjörn Stenberg <bjorn@haxx.se>2003-07-04 08:20:30 +0000
commit745eed6c4730a56f1c6ec75ed8457c0549856ba5 (patch)
treefb2b73e73cfe64075afd6836c95878d1219ebda9 /apps
parentc47f8c042c81926ee88d5d8739ff1988d4113d42 (diff)
Fix For Inaccurate Elapsed Run Time, by Craigh Sather
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3809 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/settings.c6
1 files changed, 4 insertions, 2 deletions
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;