summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chickadee.scm6
-rw-r--r--doc/api.texi5
2 files changed, 11 insertions, 0 deletions
diff --git a/chickadee.scm b/chickadee.scm
index 10085ae..e2d8624 100644
--- a/chickadee.scm
+++ b/chickadee.scm
@@ -63,6 +63,7 @@
set-window-size!
set-window-position!
set-window-fullscreen!
+ elapsed-time
controller-button-pressed?
controller-button-released?
controller-axis
@@ -76,6 +77,11 @@
run-game)
#:re-export (abort-game))
+(define (elapsed-time)
+ "Return the number of milliseconds that have passed since the game
+loop was started."
+ (sdl-ticks))
+
(define (key-pressed? key)
"Return #t if KEY is currently being pressed."
(sdl2:key-pressed? key))
diff --git a/doc/api.texi b/doc/api.texi
index cf82b6f..a8bac69 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -353,6 +353,11 @@ behavior is to simply re-throw the error.
@end deffn
+@deffn {Procedure} elapsed-time
+Return the number of milliseconds that have passed since the game loop
+was started.
+@end deffn
+
@node Input Devices
@subsection Input Devices