File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,10 +28,7 @@ class RTC
2828 using timestamp_t = int64_t ;
2929
3030 // / returns a 64-bit unix timestamp of the current time
31- static timestamp_t get ();
32-
33- static timestamp_t now ()
34- { return get (); }
31+ static timestamp_t now ();
3532
3633 // / start an auto-calibration process
3734 static void init ();
Original file line number Diff line number Diff line change @@ -28,10 +28,10 @@ void RTC::init()
2828 });
2929}
3030
31- RTC::timestamp_t RTC::get ()
31+ RTC::timestamp_t RTC::now ()
3232{
3333 auto ticks = hw::CPU::rdtsc () - current_ticks;
3434 auto diff = ticks / Hz (MHz (_CPUFreq_)).count ();
35-
35+
3636 return current_time + diff;
3737}
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ int wait(int* UNUSED(status)) {
149149}
150150
151151int gettimeofday (struct timeval * p, void *) {
152- p->tv_sec = RTC::get ();
152+ p->tv_sec = RTC::now ();
153153 p->tv_usec = 0 ;
154154 return 0 ;
155155}
@@ -212,7 +212,7 @@ void abort_ex(const char* why) {
212212// Basic second-resolution implementation - using CMOS directly for now.
213213int clock_gettime (clockid_t clk_id, struct timespec *tp){
214214 if (clk_id == CLOCK_REALTIME) {
215- tp->tv_sec = RTC::get ();
215+ tp->tv_sec = RTC::now ();
216216 tp->tv_nsec = 0 ;
217217 return 0 ;
218218 }
You can’t perform that action at this time.
0 commit comments