mirror of
https://github.com/IllusionMan1212/O2048.git
synced 2026-10-24 10:12:37 +00:00
36 lines
487 B
Odin
36 lines
487 B
Odin
package zephr
|
|
|
|
import "core:fmt"
|
|
import "core:time"
|
|
|
|
TimerState :: enum {
|
|
RUNNING,
|
|
PAUSED,
|
|
STOPPED,
|
|
}
|
|
|
|
Timer :: struct {
|
|
start: f64,
|
|
elapsed: f64,
|
|
duration: f32,
|
|
state: TimerState,
|
|
}
|
|
|
|
@private
|
|
TIMER : time.Stopwatch
|
|
|
|
@private
|
|
start_internal_timer :: proc() {
|
|
time.stopwatch_start(&TIMER)
|
|
}
|
|
|
|
get_time :: proc() -> time.Duration {
|
|
return time.stopwatch_duration(TIMER)
|
|
}
|
|
|
|
start_timer :: proc(timer: ^time.Stopwatch) {
|
|
time.stopwatch_start(timer)
|
|
}
|
|
|
|
// TODO: incomplete
|