60 lines · 1.2 KB · Text
RawDownload
.TH CPUTIME 2.SH NAMEcputime, times, cycles \- cpu time in this process and children.SH SYNOPSIS.B #include <u.h>.br.B #include <libc.h>.PP.ta \w'\fLdouble 'u.Bint	times(long t[4]).PP.Bdouble	cputime(void).PP.Bvoid	cycles(vlong *cyclep).SH DESCRIPTIONIf.I tis non-null,.I timesfills it inwith the number of milliseconds spent in user code, system calls,child processes in user code, and child processes in system calls..I Cputimereturns the sum of those same times, converted to seconds..I Timesreturns the elapsed real time, in milliseconds, that the process has been running..PPThese functions read.BR /dev/cputime ,opening that file when they are first called..PP.I Cyclesreads the processor's timestamp counter of cycles since reset,if any, and stores it via.IR cyclep .Currently supported architectures are.BR 386 ,.BR amd64 ,and.BR power ;on all others,.I cycleswill store zero..SH SOURCE.B /sys/src/libc/9sys.br.B /sys/src/libc/*/cycles.[cs].SH SEE ALSO.IR exec (2),.IR cons (3).SH BUGSOnly.B 386processors starting with the Pentium have timestamp counters;calling.I cycleson earlier processors may execute an illegal instruction.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t