summaryrefslogtreecommitdiff
path: root/examples/gravity.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gravity.c')
-rwxr-xr-xexamples/gravity.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/examples/gravity.c b/examples/gravity.c
index 8bc45e0..246aab1 100755
--- a/examples/gravity.c
+++ b/examples/gravity.c
@@ -40,13 +40,6 @@ typedef struct {
Entity entities[10 * 1024 * 1024];
} World;
-i64 time_milliseconds() {
- struct timespec t;
- timespec_get(&t, TIME_UTC);
-
- return (i64) t.tv_sec * 1000ll + (i64) t.tv_nsec / 1000000ll;
-}
-
i32 main(i32 argc, c8 **argv) {
(void) argc;
(void) argv;
@@ -64,12 +57,12 @@ i32 main(i32 argc, c8 **argv) {
srand(time(0));
static World world = {0};
- i64 time_0 = time_milliseconds();
+ i64 time_0 = p_time();
while (!platform.done) {
p_handle_events();
- i64 time_elapsed = time_milliseconds() - time_0;
+ i64 time_elapsed = p_time() - time_0;
time_0 += time_elapsed;
if (platform.key_pressed[BUTTON_LEFT]) {