// SPDX-FileCopyrightText: 2024 Lizzy Fleckenstein // // SPDX-License-Identifier: AGPL-3.0-or-later #ifndef TICKER_H #define TICKER_H #include #include #include #define NANOS 1000000000 typedef struct { struct timespec timestamp; uint64_t freq_nanos; } ticker; void ticker_init(ticker *t, uint64_t f); bool ticker_tick(ticker *t, uint64_t *dtime); int ticker_timeout(ticker *t); #endif