clock - Online Linux Manual PageSection : 3
Updated : 2022-12-29
Source : Linux man-pages 6.03
NAMEclock − determine processor time
LIBRARYStandard C library (libc, −lc)
SYNOPSIS#include <time.h>clock_t clock(void);
DESCRIPTIONThe clock() function returns an approximation of processor time used by the program.
RETURN VALUEThe value returned is the CPU time used so far as a clock_t; to get the number of seconds used, divide by CLOCKS_PER_SEC. If the processor time used is not available or its value cannot be represented, the function returns the value (clock_t) −1.
ATTRIBUTESFor an explanation of the terms used in this section, see attributes(7). InterfaceAttributeValue clock() Thread safetyMT-Safe
STANDARDSPOSIX.1-2001, POSIX.1-2008, C99. XSI requires that CLOCKS_PER_SEC equals 1000000 independent of the actual resolution.
NOTESThe C standard allows for arbitrary values at the start of the program; subtract the value returned from a call to clock() at the start of the program to get maximum portability. Note that the time can wrap around. On a 32-bit system where CLOCKS_PER_SEC equals 1000000 this function will return the same value approximately every 72 minutes. On several other implementations, the value returned by clock() also includes the times of any children whose status has been collected via wait(2) (or another wait-type call). Linux does not include the times of waited-for children in the value returned by clock(). The times(2) function, which explicitly returns (separate) information about the caller and its children, may be preferable. In glibc 2.17 and earlier, clock() was implemented on top of times(2). For improved accuracy, since glibc 2.18, it is implemented on top of clock_gettime(2) (using the CLOCK_PROCESS_CPUTIME_ID clock).
SEE ALSOclock_gettime(2), getrusage(2), times(2) 0
Johanes Gumabo
Data Size : 7,779 byte
man-clock.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 200,244
Visitor ID : :
Visitor IP : 3.144.116.34 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.