Remove the ticks counter

This commit is contained in:
Baptiste Wicht 2016-08-10 19:55:18 +02:00
parent 32c906fde6
commit 9e814f2a2f
2 changed files with 3 additions and 21 deletions

View File

@ -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
*/ */

View File

@ -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(){