// file : core/timer.h // project : Salis-VM // author : Paul Oliver // // Utilities to help measure time intervals and simulation speed. #pragma once struct Timer { struct timespec time_start; float time_delta; }; struct TimerSPS { struct Timer timer; uint64_t step_start; float steps_per_sec; }; void timer_reset(struct Timer *timer); void timer_measure(struct Timer *timer); void timer_sps_reset(struct TimerSPS *timer_sps); void timer_sps_measure(struct TimerSPS *timer_sps);