getbinuptime (9)
Leading comments
Copyright (c) 2000 Kelly Yancey All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other...
NAME
binuptime getbinuptime microuptime getmicrouptime nanouptime getnanouptime sbinuptime getsbinuptime - get the time elapsed since bootSYNOPSIS
In sys/time.h Ft void Fn binuptime struct bintime *bt Ft void Fn getbinuptime struct bintime *bt Ft void Fn microuptime struct timeval *tv Ft void Fn getmicrouptime struct timeval *tv Ft void Fn nanouptime struct timespec *ts Ft void Fn getnanouptime struct timespec *tsp Ft sbintime_t Fn sbinuptime void Ft sbintime_t Fn getsbinuptime voidDESCRIPTION
The Fn binuptime and Fn getbinuptime functions store the time elapsed since boot as a Vt struct bintime at the address specified by Fa bt . The Fn microuptime and Fn getmicrouptime functions perform the same utility, but record the elapsed time as a Vt struct timeval instead. Similarly the Fn nanouptime and Fn getnanouptime functions store the elapsed time as a Vt struct timespec . The Fn sbinuptime and Fn getsbinuptime functions return the time elapsed since boot as a Vt sbintime_t .The Fn binuptime , Fn microuptime , Fn nanouptime , and Fn sbinuptime functions always query the timecounter to return the current time as precisely as possible. Whereas Fn getbinuptime , Fn getmicrouptime , Fn getnanouptime , and Fn getsbinuptime functions are abstractions which return a less precise, but faster to obtain, time.
The intent of the Fn getbinuptime , Fn getmicrouptime , Fn getnanouptime , and Fn getsbinuptime functions is to enforce the user's preference for timer accuracy versus execution time.