.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992 .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Modified by Michael Haardt (michael@moria.de) .\" Modified Sat Jul 24 14:29:17 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 961203 and 001211 and 010326 by aeb@cwi.nl .\" Modified 001213 by Michael Haardt (michael@moria.de) .\" Modified 13 Jun 02, Michael Kerrisk .\" Added note on nonstandard behavior when SIGCHLD is ignored. .\" Modified 2004-11-16, mtk, Noted that the nonconformance when .\" SIGCHLD is being ignored is fixed in 2.6.9; other minor changes .\" Modified 2004-12-08, mtk, in 2.6 times() return value changed .\" 2005-04-13, mtk .\" Added notes on nonstandard behavior: Linux allows 'buf' to .\" be NULL, but POSIX.1 doesn't specify this and it's nonportable. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH TIMES 2 "15 Septiembre 2017" Linux "Manual del Programador de Linux" .SH NOMBRE times \- obtiene los tiempos del proceso .SH SINOPSIS \fB#include \fP .PP \fBclock_t times(struct tms *\fP\fIbuf\fP\fB);\fP .SH DESCRIPCIÓN \fBtimes\fP() almacena los tiempos del proceso en curso en la estructura \fItms\fP a la que apunta \fIbuf.\fP La estructura \fItms\fP es tal como se define en \fI\fP: .PP .in +4n .EX struct tms { clock_t tms_utime; /* tiempo de usuario */ clock_t tms_stime; /* tiempo de sistema */ clock_t tms_cutime; /* tiempo de usuario de los hijos */ clock_t tms_cstime; /* tiempo de sistema de los hijos */ }; .EE .in .PP El campo \fItms_utime\fP contiene el tiempo de CPU empleado en la ejecución de instrucciones del proceso invocador. El campo \fItms_stime\fP contiene el tiempo de CPU empleado en el sistema mientras se ejecutan tareas en nombre del proceso invocador. .PP El campo \fItms_cutime\fP contiene la suma de los valores \fItms_utime\fP y \fItms_cutime\fP de todos los hijos terminados a los que se esperó. El campo \fItms_cstime\fP contiene la suma de los valores \fItms_stime\fP y \fItms_cstime\fP de todos los hijos terminados a los que se esperó. .PP Los tiempos para los hijos terminados (y sus descendientes) son añadidos en el momento en el que \fBwait\fP(2) o \fBwaitpid\fP(2) devuelve su identificador de proceso. En particular, los tiempos de los "nietos" a los que los hijos no esperaron no son procesados. .PP Todos los tiempos informados se dan en ticks de reloj. .SH "VALOR DEVUELTO" \fBtimes\fP() returns the number of clock ticks that have elapsed since an arbitrary point in the past. The return value may overflow the possible range of type \fIclock_t\fP. On error, \fI(clock_t)\ \-1\fP is returned, and \fIerrno\fP is set appropriately. .SH ERRORES .TP \fBEFAULT\fP \fItms\fP apunta fuera del espacio de direcciones asignado al proceso. .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.3BSD. .SH NOTAS El número de ticks de reloj por segundo puede obtenerse usando: .PP .in +4n .EX sysconf(_SC_CLK_TCK); .EE .in .PP En POSIX.1\-1996 el símbolo \fBCLK_TCK\fP (definido en \fI\fP) se menciona como obsoleto. Está obsoleto en la actualidad. .PP .\" See the description of times() in XSH, which says: .\" The times of a terminated child process are included... when wait() .\" or waitpid() returns the process ID of this terminated child. In Linux kernel versions before 2.6.9, if the disposition of \fBSIGCHLD\fP is set to \fBSIG_IGN\fP, then the times of terminated children are automatically included in the \fItms_cstime\fP and \fItms_cutime\fP fields, although POSIX.1\-2001 says that this should happen only if the calling process \fBwait\fP(2)s on its children. This nonconformance is rectified in Linux 2.6.9 and later. .PP On Linux, the \fIbuf\fP argument can be specified as NULL, with the result that \fBtimes\fP() just returns a function result. However, POSIX does not specify this behavior, and most other UNIX implementations require a non\-NULL value for \fIbuf\fP. .PP Note that \fBclock\fP(3) also returns a value of type \fIclock_t\fP, but this value is measured in units of \fBCLOCKS_PER_SEC\fP, not the clock ticks used by \fBtimes\fP(). .PP .\" .PP .\" On older systems the number of clock ticks per second is given .\" by the variable HZ. On Linux, the "arbitrary point in the past" from which the return value of \fBtimes\fP() is measured has varied across kernel versions. On Linux 2.4 and earlier, this point is the moment the system was booted. Since Linux 2.6, this point is \fI(2^32/HZ) \- 300\fP seconds before system boot time. This variability across kernel versions (and across UNIX implementations), combined with the fact that the returned value may overflow the range of \fIclock_t\fP, means that a portable application would be wise to avoid using this value. To measure changes in elapsed time, use \fBclock_gettime\fP(2) instead. .SS Histórico SVr1\-3 devuelve \fIlong\fP y los miembros de la estructura son de tipo \fItime_t\fP aunque almacenan ticks de reloj, no segundos desde la época. V7 usaba \fIlong\fP para los miembros de la estructura, porque no disponía del tipo \fItime_t\fP todavía. .SH ERRORES .\" The problem is that a syscall return of -4095 to -1 .\" is interpreted by glibc as an error, and the wrapper converts .\" the return value to -1. .\" http://marc.info/?l=linux-kernel&m=119447727031225&w=2 .\" "compat_sys_times() bogus until jiffies >= 0" .\" November 2007 A limitation of the Linux system call conventions on some architectures (notably i386) means that on Linux 2.6 there is a small time window (41 seconds) soon after boot when \fBtimes\fP() can return \-1, falsely indicating that an error occurred. The same problem can occur when the return value wraps past the maximum value that can be stored in \fBclock_t\fP. .SH "VÉASE TAMBIÉN" \fBtime\fP(1), \fBgetrusage\fP(2), \fBwait\fP(2), \fBclock\fP(3), \fBsysconf\fP(3), \fBtime\fP(7) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García y Miguel Pérez Ibars . .PP Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. .PP Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org .ME .