Skip to content

Commit

Permalink
Added: time: mfps -> converts f/s to ms/f
Browse files Browse the repository at this point in the history
  • Loading branch information
zakarouf committed Feb 5, 2024
1 parent bcbf280 commit 4fd0f0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions src/lib/z__time.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4fd0f0c

Please sign in to comment.