forsyth20121205-174063a80cc13 years agoHistory
64 lines · 1.3 KB · Text
RawDownload
.TH SECONDS 10.2.SH NAMEseconds, ticks, HZ, MS2HZ, MS2TK, TK2MS, TK2SEC \- kernel times and time conversions.SH SYNOPSIS.ta \w'\fL#define 'u.Blong	seconds(void).PP.Bulong   	ticks(void).PP.EX#define	HZ          ...#define	MS2HZ(t)    ...#define	TK2SEC(t)   ...#define	TK2MS(t)    ...#define	MS2TK(m)    ....EE.SH DESCRIPTION.I Secondsreturns the system's idea of the current time as the number of secondssince the start of the epoch(00:00:00 GMT, January 1, 1970)..PP.I Ticksreturns the number of system-dependent clock ticks since system boot..PPThe system clock frequency is platform-dependent.Several symbolic constants and macro functions are defined bythe file.B mem.hto convert between different time units:.TF TK2SEC(t).PD.TP.B HZThe number of clock ticks per second..TP.B MS2HZMilliseconds per clock tick..TP.BI TK2SEC( t )Convert.I tclock ticks to seconds and return the result (truncating not rounding)..TP.BI TK2MS( t )Convert.I tclock ticks to milliseconds and return the result..TP.BI MS2TK( m )Convert.I mmilliseconds to clock ticks and return the result (truncating)..PPThe functions are often used to calculate delays for timing functions,for instance:.IP.EXif(atactlrwait(dp->cp, DHmagic, 0, MS2TK(100))){	...}.EE