📄 times.2
字号:
.\" Copyright (c) 1980 Regents of the University of California..\" All rights reserved. The Berkeley software License Agreement.\" specifies the terms and conditions for redistribution..\".\" @(#)times.3c 6.1 (Berkeley) 5/9/85.\".TH TIMES 2 "May 9, 1985".UC 4.SH NAMEtimes \- get process times.SH SYNOPSIS.nf.ft B#include <sys/types.h>#include <sys/times.h>#include <time.h>int times(struct tms *\fIbuffer\fP).fi.SH DESCRIPTION.B Timesreturns time-accounting informationfor the current processand for the terminated child processesof the current process.All times are in 1/CLOCKS_PER_SEC seconds..PPThis is the structure returned by.BR times :.PP.RS.nf.ta +0.4i +0.8i +1.2istruct tms { clock_t tms_utime; /* user time for this process */ clock_t tms_stime; /* system time for this process */ clock_t tms_cutime; /* children's user time */ clock_t tms_cstime; /* children's system time */};.fi.RE.PPThe user time is the number of clock ticks used by a process onits own computations. The system time is the number of clock ticksspent inside the kernel on behalf of a process. This does notinclude time spent waiting for I/O to happen, only actual CPUinstruction times..PPThe children times are the sumof the children's process times andtheir children's times..SH RETURN.B Timesreturns 0 on success, otherwise \-1 with the error code stored into theglobal variable.BR errno ..SH ERRORSThe following error code may be set in.BR errno :.TP 15[EFAULT]The address specified by the.I bufferparameter is not in a valid part of the process address space..SH "SEE ALSO".BR time (1),.BR wait (2),.BR time (2).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -