diff --git a/kitty/monotonic.h b/kitty/monotonic.h index db6a4254b..cb91dcb3f 100644 --- a/kitty/monotonic.h +++ b/kitty/monotonic.h @@ -13,6 +13,7 @@ #define MONOTONIC_T_MAX INT64_MAX #define MONOTONIC_T_MIN INT64_MIN #define MONOTONIC_T_1e6 1000000ll +#define MONOTONIC_T_1e3 1000ll #define MONOTONIC_T_1e9 1000000000ll typedef int64_t monotonic_t; @@ -42,6 +43,12 @@ monotonic_t_to_ms(monotonic_t time) { return (int)(time / MONOTONIC_T_1e6); } +static inline int +monotonic_t_to_us(monotonic_t time) { + return (int)(time / MONOTONIC_T_1e3); +} + + static inline double monotonic_t_to_s_double(monotonic_t time) { return ((double)time) / 1e9;