My Kernel v0.1.0
time.h
Go to the documentation of this file.
1
8#ifndef KERNEL_TIME_H
9#define KERNEL_TIME_H
10
11/*
12 * The number of clock ticks in a second (100Hz, 1 tick = 100ms).
13 *
14 * This is also used as the maximum time a thread is allowed to run for
15 * before being rescheduled (thread will be forcefully rescheduled
16 * when a timer interrupt eventually occurs).
17 */
18#define TICKS_PER_SECOND 100
19
21#define SEC(_x) (_x)
22#define MS(_s) (1000 * SEC(_s))
23#define US(_s) (1000 * MS((_s)))
24#define NS(_s) (1000 * US((_s)))
28#define SEC_TO_SEC(_s) SEC(_s)
29#define MS_TO_SEC(_s) (SEC(_s) / 1000)
30#define US_TO_SEC(_s) (MS((_s)) / 1000)
31#define NS_TO_SEC(_s) (US((_s)) / 1000)
34#endif /* KERNEL_TIME_H */
35