summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-02-24 22:47:17 -0500
committerpommicket <pommicket@gmail.com>2025-02-25 15:16:08 -0500
commitcfd34de0dbedc7c2aca2c03853ddbd4489a1244e (patch)
tree041faf02c11c000e0393c59581985fb96745937a /util.h
parente6d427b9406d565bd3b6dc069f1941533adee34f (diff)
start framerate menu
Diffstat (limited to 'util.h')
-rw-r--r--util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/util.h b/util.h
index 4db637a..0a87c0c 100644
--- a/util.h
+++ b/util.h
@@ -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;
+}