Skip to content
Snippets Groups Projects
Commit ec81df3d authored by Nadav Har'El's avatar Nadav Har'El Committed by Pekka Enberg
Browse files

clock: Use new clock APIs in BSD time functions


Reimplement the BSD functions getmicrotime(9), getmicrouptime(9)
and variable "ticks", using the new clock APIs.

getmicrotime() returns the system time ("wall clock"), while getmicrouptime
and ticks return the time since boot.

I believe this is the correct implementation according to the FreeBSD
documentation, but our previous implementation didn't quite do this and
it also worked ;-) The previous implementation pretended, according to
getmicrouptime() and get_ticks(), that the system is up since 1970,
and yet the variable "time_uptime" (which FreeBSD has) is never updated,
and is fixed at 1 second :-)

Reviewed-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 99eafa7e
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment