diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-24 08:05:50 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-26 11:09:20 +0200 |
commit | 3489e8682089c71c42b30eca80d7230b2ecf44f8 (patch) | |
tree | 2413cb5bec912ab8213d4dc22bb69ea4467bb737 /include/mgl/system | |
parent | 115630b520668304af1ccd3eb0b13c06e17ecccc (diff) |
Add clock
Diffstat (limited to 'include/mgl/system')
-rw-r--r-- | include/mgl/system/clock.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/mgl/system/clock.h b/include/mgl/system/clock.h new file mode 100644 index 0000000..f207ff7 --- /dev/null +++ b/include/mgl/system/clock.h @@ -0,0 +1,13 @@ +#ifndef MGL_CLOCK_H +#define MGL_CLOCK_H + +typedef struct { + double captured_seconds; +} mgl_clock; + +void mgl_clock_init(mgl_clock *self); +/* Returns the elapsed time in seconds since the last restart or init, before resetting the clock */ +double mgl_clock_restart(mgl_clock *self); +double mgl_clock_get_elapsed_time_seconds(mgl_clock *self); + +#endif /* MGL_CLOCK_H */ |