@node uclock, time @subheading Syntax @example #include uclock_t uclock(void); @end example @subheading Description This function returns the number of uclock ticks since an arbitrary time, actually, since the first call to @code{uclock}, which itself returns zero. The number of tics per second is @code{UCLOCKS_PER_SEC} (declared in the @file{time.h} header file. @code{uclock} is provided for very high-resulution timing. It is currently accurate to better than 1 microsecond (actually about 840 nanoseconds). You cannot time across two midnights with this implementation, giving a maximum useful period of 48 hours and an effective limit of 24 hours. Casting to a 32-bit integer limits its usefulness to about an hour before 32 bits will wrap. Note that @code{printf} will only print a value of type @code{uclock_t} correctly if you use format specifiers for @code{long long} data, such as @code{%Ld} or @code{%lld}, because @code{uclock_t} is a 64-bit integer. @xref{printf}. Also note that @code{uclock} reprograms the interval timer in your PC to act as a rate generator rather than a square wave generator. I've had no problems running in this mode all the time, but if you notice strange things happening with the clock (losing time) after using @code{uclock}, check to see if this is the cause of the problem. Windows 3.X doesn't allow to reprogram the timer, so the values returned by @code{uclock} there are incorrect. DOS and Windows 9X don't have this problem. @subheading Return Value The number of tics. @subheading Portability @portability !ansi, !posix @subheading Example @example printf("%Ld seconds have elapsed\n", (long long)(uclock()/UCLOCKS_PER_SEC)); @end example