1ae5ccfadSAlexey Zelkin.\" Copyright (c) 2000 Kelly Yancey 2ae5ccfadSAlexey Zelkin.\" All rights reserved. 3ae5ccfadSAlexey Zelkin.\" 4ae5ccfadSAlexey Zelkin.\" Redistribution and use in source and binary forms, with or without 5ae5ccfadSAlexey Zelkin.\" modification, are permitted provided that the following conditions 6ae5ccfadSAlexey Zelkin.\" are met: 7ae5ccfadSAlexey Zelkin.\" 1. Redistributions of source code must retain the above copyright 8ae5ccfadSAlexey Zelkin.\" notice, this list of conditions and the following disclaimer. 9ae5ccfadSAlexey Zelkin.\" 2. Redistributions in binary form must reproduce the above copyright 10ae5ccfadSAlexey Zelkin.\" notice, this list of conditions and the following disclaimer in the 11ae5ccfadSAlexey Zelkin.\" documentation and/or other materials provided with the distribution. 12ae5ccfadSAlexey Zelkin.\" 13ae5ccfadSAlexey Zelkin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14ae5ccfadSAlexey Zelkin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15ae5ccfadSAlexey Zelkin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16ae5ccfadSAlexey Zelkin.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17ae5ccfadSAlexey Zelkin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18ae5ccfadSAlexey Zelkin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19ae5ccfadSAlexey Zelkin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20ae5ccfadSAlexey Zelkin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21ae5ccfadSAlexey Zelkin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22ae5ccfadSAlexey Zelkin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23ae5ccfadSAlexey Zelkin.\" SUCH DAMAGE. 24ae5ccfadSAlexey Zelkin.\" 25ae5ccfadSAlexey Zelkin.\" $FreeBSD$ 26ae5ccfadSAlexey Zelkin.\" 27c0854fb7SRuslan Ermilov.Dd September 16, 2004 28ae5ccfadSAlexey Zelkin.Dt MICROUPTIME 9 293d45e180SRuslan Ermilov.Os 30ae5ccfadSAlexey Zelkin.Sh NAME 3135779bdbSBrooks Davis.Nm binuptime , 3235779bdbSBrooks Davis.Nm getbinuptime , 33ae5ccfadSAlexey Zelkin.Nm microuptime , 34ae5ccfadSAlexey Zelkin.Nm getmicrouptime , 35ae5ccfadSAlexey Zelkin.Nm nanouptime , 36ae5ccfadSAlexey Zelkin.Nm getnanouptime 37ae5ccfadSAlexey Zelkin.Nd get the time elapsed since boot 38ae5ccfadSAlexey Zelkin.Sh SYNOPSIS 3932eef9aeSRuslan Ermilov.In sys/time.h 40ae5ccfadSAlexey Zelkin.Ft void 4135779bdbSBrooks Davis.Fn binuptime "struct bintime *bt" 4235779bdbSBrooks Davis.Ft void 4335779bdbSBrooks Davis.Fn getbinuptime "struct bintime *bt" 4435779bdbSBrooks Davis.Ft void 45ae5ccfadSAlexey Zelkin.Fn microuptime "struct timeval *tv" 46ae5ccfadSAlexey Zelkin.Ft void 47ae5ccfadSAlexey Zelkin.Fn getmicrouptime "struct timeval *tv" 48ae5ccfadSAlexey Zelkin.Ft void 49ae5ccfadSAlexey Zelkin.Fn nanouptime "struct timespec *ts" 50ae5ccfadSAlexey Zelkin.Ft void 51ae5ccfadSAlexey Zelkin.Fn getnanouptime "struct timespec *tsp" 52ae5ccfadSAlexey Zelkin.Sh DESCRIPTION 53ae5ccfadSAlexey ZelkinThe 5435779bdbSBrooks Davis.Fn binuptime 5535779bdbSBrooks Davisand 5635779bdbSBrooks Davis.Fn getbinuptime 5735779bdbSBrooks Davisfunctions store the time elapsed since boot as a 58c0854fb7SRuslan Ermilov.Vt "struct bintime" 5935779bdbSBrooks Davisat the address specified by 6035779bdbSBrooks Davis.Fa bt . 6135779bdbSBrooks DavisThe 62ae5ccfadSAlexey Zelkin.Fn microuptime 63ae5ccfadSAlexey Zelkinand 64ae5ccfadSAlexey Zelkin.Fn getmicrouptime 6535779bdbSBrooks Davisfunctions perform the same utility, but record the elapsed time as a 66c0854fb7SRuslan Ermilov.Vt "struct timeval" 6735779bdbSBrooks Davisinstead. 6835779bdbSBrooks DavisSimilarly the 69ae5ccfadSAlexey Zelkin.Fn nanouptime 70ae5ccfadSAlexey Zelkinand 71ae5ccfadSAlexey Zelkin.Fn getnanouptime 7235779bdbSBrooks Davisfunctions store the elapsed time as a 73c0854fb7SRuslan Ermilov.Vt "struct timespec" . 74ae5ccfadSAlexey Zelkin.Pp 75c0854fb7SRuslan ErmilovThe 76c0854fb7SRuslan Ermilov.Fn binuptime , 7735779bdbSBrooks Davis.Fn microuptime , 78ae5ccfadSAlexey Zelkinand 79ae5ccfadSAlexey Zelkin.Fn nanouptime 80c0854fb7SRuslan Ermilovfunctions 81ae5ccfadSAlexey Zelkinalways query the timecounter to return the current time as precisely as 821111b49cSSheldon Hearnpossible. 831111b49cSSheldon HearnWhereas 8435779bdbSBrooks Davis.Fn getbinuptime , 8535779bdbSBrooks Davis.Fn getmicrouptime , 86ae5ccfadSAlexey Zelkinand 87ae5ccfadSAlexey Zelkin.Fn getnanouptime 8816aa79c2SMark Murrayfunctions are abstractions which return a less precise, but 891111b49cSSheldon Hearnfaster to obtain, time. 90ae5ccfadSAlexey Zelkin.Pp 91ae5ccfadSAlexey ZelkinThe intent of the 9235779bdbSBrooks Davis.Fn getbinuptime , 9335779bdbSBrooks Davis.Fn getmicrouptime , 94ae5ccfadSAlexey Zelkinand 95ae5ccfadSAlexey Zelkin.Fn getnanouptime 96ae5ccfadSAlexey Zelkinfunctions is to enforce the user's preference for timer accuracy versus 97ae5ccfadSAlexey Zelkinexecution time. 98ae5ccfadSAlexey Zelkin.Sh SEE ALSO 9935779bdbSBrooks Davis.Xr bintime 9 , 10035779bdbSBrooks Davis.Xr getbintime 9 , 101ae5ccfadSAlexey Zelkin.Xr getmicrotime 9 , 102ae5ccfadSAlexey Zelkin.Xr getnanotime 9 , 103ae5ccfadSAlexey Zelkin.Xr microtime 9 , 104ae5ccfadSAlexey Zelkin.Xr nanotime 9 , 105ae5ccfadSAlexey Zelkin.Xr tvtohz 9 106ae5ccfadSAlexey Zelkin.Sh AUTHORS 107ae5ccfadSAlexey ZelkinThis manual page was written by 108ae5ccfadSAlexey Zelkin.An Kelly Yancey Aq kbyanc@posi.net . 109