diff options
author | pommicket <pommicket@gmail.com> | 2025-02-24 22:47:17 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-02-25 15:16:08 -0500 |
commit | cfd34de0dbedc7c2aca2c03853ddbd4489a1244e (patch) | |
tree | 041faf02c11c000e0393c59581985fb96745937a /util.h | |
parent | e6d427b9406d565bd3b6dc069f1941533adee34f (diff) |
start framerate menu
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -35,3 +35,12 @@ static double get_time_double(void) { clock_gettime(CLOCK_MONOTONIC, &ts); return (double)ts.tv_sec + (double)ts.tv_nsec * 1e-9; } + +static uint8_t popcount64(uint64_t x) { + uint8_t cnt = 0; + while (x) { + x &= x - 1; + cnt++; + } + return cnt; +} |