From 4fd0f0c74ea1a6de836fa46c75d144a3f61788e9 Mon Sep 17 00:00:00 2001 From: zakarouf Date: Tue, 6 Feb 2024 00:05:58 +0530 Subject: [PATCH] Added: time: mfps -> converts f/s to ms/f --- src/lib/time.h | 2 +- src/lib/z__time.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/time.h b/src/lib/time.h index 7887d84..9ab69d8 100644 --- a/src/lib/time.h +++ b/src/lib/time.h @@ -22,6 +22,6 @@ z__u64 z__time(void); z__u64 z__time_process(void); z__u64 z__time_tps(void); z__f64 z__time_delta(z__u64 process_0, z__u64 process_1); - +z__u64 z__time_mfps(z__u32 fps); #endif diff --git a/src/lib/z__time.c b/src/lib/z__time.c index ff03c26..126a734 100644 --- a/src/lib/z__time.c +++ b/src/lib/z__time.c @@ -52,6 +52,12 @@ z__u64 z__time_process(void) return clock(); } +z__u64 z__time_mfps(z__u32 fps) +{ + z__float x = 1.0f/fps; + return (z__u64)(x * 1000); +} + z__u64 z__time_tps(void) { return CLOCKS_PER_SEC;