.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" .\" %%%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 Sat Jul 24 21:27:01 1993 by Rik Faith (faith@cs.unc.edu) .\" Modified 14 Jun 2002, Michael Kerrisk .\" Added notes on differences from other UNIX systems with respect to .\" waited-for children. .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH CLOCK 3 "15 Septiembre 2017" GNU "Manual del Programador de Linux" .SH NOMBRE clock \- determina el tiempo de uso del procesador .SH SINOPSIS .nf \fB#include \fP .PP \fBclock_t clock(void);\fP .fi .SH DESCRIPCIÓN La función \fBclock\fP() devuelve una aproximación del tiempo del procesador usado por el programa. .SH "VALOR DEVUELTO" El valor devuelto es el tiempo de CPU usado medido en \fIclock_t\fP; para obtener el equivalente en segundos, divida el valor devuelto por \fBCLOCKS_PER_SEC\fP. Si el tiempo de procesador usado no está disponible o su valor no puede ser representado, la función devuvelve el valor \fI(clock_t)\ \-1\fP. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interfaz Atributo Valor T{ \fBclock\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH "CONFORME A" POSIX.1\-2001, POSIX.1\-2008, C89, C99. XSI necesita que \fBCLOCKS_PER_SEC\fP sea igual a 1000000 independientemente de la resolución real. .SH NOTAS El C estándar permite que la función devuelva valores arbitrarios al comienzo del programa. Reste el valor devuelto por una llamada \fBclock\fP() al comienzo del programa para obtener la máxima portabilidad. .PP Dese cuenta que el tiempo puede volver a ser 0. En un sistema de 32 bits donde \fBCLOCKS_PER_SEC\fP es igual a 1000000, esta función devolverá el mismo valor cada 72 minutos, aproximadamente. .PP .\" I have seen this behavior on Irix 6.3, and the OSF/1, HP/UX, and .\" Solaris manual pages say that clock() also does this on those systems. .\" POSIX.1-2001 doesn't explicitly allow this, nor is there an .\" explicit prohibition. -- MTK On several other implementations, the value returned by \fBclock\fP() also includes the times of any children whose status has been collected via \fBwait\fP(2) (or another wait\-type call). Linux does not include the times of waited\-for children in the value returned by \fBclock\fP(). The \fBtimes\fP(2) function, which explicitly returns (separate) information about the caller and its children, may be preferable. .PP In glibc 2.17 and earlier, \fBclock\fP() was implemented on top of \fBtimes\fP(2). For improved accuracy, since glibc 2.18, it is implemented on top of \fBclock_gettime\fP(2) (using the \fBCLOCK_PROCESS_CPUTIME_ID\fP clock). .SH "VÉASE TAMBIÉN" \fBclock_gettime\fP(2), \fBgetrusage\fP(2), \fBtimes\fP(2) .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 Sebastian Desimone , Rafael Rios , Juan Piernas 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 .