.\" -*- coding: UTF-8 -*- '\" t .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" .\" 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 "20 ​​Julio 2023" "Páginas de manual de Linux 6.05.01" .SH NOMBRE clock \- determina el tiempo de uso del procesador .SH BIBLIOTECA Biblioteca Estándar C (\fIlibc\fP, \fI\-lc\fP) .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; lbx lb lb l l l. Interfaz Atributo Valor T{ .na .nh \fBclock\fP() T} Seguridad del hilo Multi\-hilo seguro .TE .sp 1 .SH VERSIONES XSI requires that \fBCLOCKS_PER_SEC\fP equals 1000000 independent of the actual resolution. .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. .SH ESTÁNDARES C11, POSIX.1\-2008. .SH HISTORIAL POSIX.1\-2001, C89. .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 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. .SH "VÉASE TAMBIÉN" \fBclock_gettime\fP(2), \fBgetrusage\fP(2), \fBtimes\fP(2) .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 .