SquidgeOS/src/kernel/timer.h

23 lines
459 B
C
Raw Normal View History

2026-05-01 23:14:44 +01:00
#ifndef TIMER_H
#define TIMER_H
#include <stdint.h>
extern _Atomic uint64_t sys_ticks;
extern const uint64_t tick_delta;
// Initialize timer (1ms ticks)
void timer_init();
// Increment the system tick counter
void timer_tick();
// Get current time in milliseconds
uint64_t timer_get_ms();
// Delay for 'ms' milliseconds (blocking)
void delay_ms(uint64_t ms);
// Sleep for 'ms' milliseconds (non-blocking, if possible)
void sleep_ms(uint64_t ms);
#endif