mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-10 13:04:53 -04:00
Remove the ticks counter
This commit is contained in:
parent
32c906fde6
commit
9e814f2a2f
@ -17,11 +17,6 @@ namespace timer {
|
|||||||
*/
|
*/
|
||||||
void install();
|
void install();
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Returns a up-counter in timer ticks
|
|
||||||
*/
|
|
||||||
uint64_t ticks();
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a up-counter in seconds
|
* \brief Returns a up-counter in seconds
|
||||||
*/
|
*/
|
||||||
|
@ -58,29 +58,16 @@ void timer::install(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void timer::tick(){
|
void timer::tick(){
|
||||||
++_timer_ticks;
|
// Simply let the scheduler know about the tick
|
||||||
|
|
||||||
scheduler::tick();
|
scheduler::tick();
|
||||||
|
|
||||||
if(_timer_ticks % timer_frequency() == 0){
|
|
||||||
++_timer_seconds;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_timer_ticks % (timer_frequency() / 1000) == 0){
|
|
||||||
++_timer_milliseconds;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t timer::ticks(){
|
|
||||||
return _timer_ticks;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t timer::seconds(){
|
uint64_t timer::seconds(){
|
||||||
return _timer_seconds;
|
return counter() / counter_frequency();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t timer::milliseconds(){
|
uint64_t timer::milliseconds(){
|
||||||
return _timer_milliseconds;
|
return counter() / (counter_frequency() / 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t timer::timer_frequency(){
|
uint64_t timer::timer_frequency(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user