summaryrefslogtreecommitdiff
path: root/starling/system.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2020-12-15 20:02:31 -0500
committerDavid Thompson <dthompson@vistahigherlearning.com>2020-12-15 20:02:31 -0500
commitc70443c83a5a337d082fc58e0067a5f14cfae805 (patch)
treefdcc5fb028ae1002dc3fa64f8cb6fd7a8a853f00 /starling/system.scm
parentb4de83ce32e382dd85cad0cc5bb697dd691e2dde (diff)
Use a more precise timer.
Diffstat (limited to 'starling/system.scm')
-rw-r--r--starling/system.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/starling/system.scm b/starling/system.scm
index 293d92d..a33647d 100644
--- a/starling/system.scm
+++ b/starling/system.scm
@@ -28,8 +28,11 @@
current-window
current-window-size))
+(define %time-freq (exact->inexact (sdl-performance-frequency)))
+
(define (elapsed-time)
- (sdl-ticks))
+ "Return the current value of the system timer in seconds."
+ (/ (sdl-performance-counter) %time-freq))
(define current-window (make-parameter #f))