forked from Bananymous/banan-os
Kerne: SystemTimer can now output the current real time
This commit is contained in:
parent
c732297623
commit
3df97c36e6
|
@ -28,6 +28,7 @@ namespace Kernel
|
|||
void sleep(uint64_t) const;
|
||||
|
||||
uint64_t get_unix_timestamp() const;
|
||||
timespec get_real_time() const;
|
||||
|
||||
private:
|
||||
SystemTimer() = default;
|
||||
|
|
|
@ -79,4 +79,11 @@ namespace Kernel
|
|||
return m_boot_time + ms_since_boot() / 1000;
|
||||
}
|
||||
|
||||
timespec SystemTimer::get_real_time() const
|
||||
{
|
||||
auto result = time_since_boot();
|
||||
result.tv_sec += m_boot_time;
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue