diff options
Diffstat (limited to 'guile/starlet/clock.scm')
-rw-r--r-- | guile/starlet/clock.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/guile/starlet/clock.scm b/guile/starlet/clock.scm index 22aba7d..c139d66 100644 --- a/guile/starlet/clock.scm +++ b/guile/starlet/clock.scm @@ -26,6 +26,7 @@ stop-clock! start-clock! reverse-clock! + reset-clock! clock-expired? set-clock-expiration-time! @@ -124,6 +125,13 @@ (set-clock-stopped! clock #f)) +(define-method (reset-clock! (clock <starlet-clock>)) + (set-start-elapsed-time! clock 0) + (set-start-real-time! clock (time-now)) + (set-clock-reversed! clock #f) + (set-clock-stopped! clock #f)) + + ;; Start the clock running, backwards (define-method (reverse-clock! (clock <starlet-clock>)) (set-start-elapsed-time! clock (elapsed-time clock)) |