summaryrefslogtreecommitdiff
path: root/os/time.h
blob: f4706e0a50bf7c04265b7ceea674250d693e359f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef TIME_H
#define TIME_H

#include "thread.h"

class Time {
	private:
		static volatile uint32_t systime;
	
	public:
		inline static void tick() {
			systime++;
		}
		
		inline static void sleep(uint32_t ms) {
			ms += systime;
			while(systime < ms) {
				Thread::yield();
			}
		}
};

#endif