noble (3) clock.3.gz

Provided by: manpages-es-dev_4.21.0-2_all bug

NOMBRE

       clock - determina el tiempo de uso del procesador

BIBLIOTECA

       Biblioteca Estándar C (libc, -lc)

SINOPSIS

       #include <time.h>

       clock_t clock(void);

DESCRIPCIÓN

       La función clock() devuelve una aproximación del tiempo del procesador usado por el programa.

VALOR DEVUELTO

       El  valor  devuelto es el tiempo de CPU usado medido en clock_t; para obtener el equivalente en segundos,
       divida el valor devuelto por CLOCKS_PER_SEC. Si el tiempo de procesador usado no  está  disponible  o  su
       valor no puede ser representado, la función devuvelve el valor (clock_t) -1.

ATRIBUTOS

       Para obtener una explicación de los términos usados en esta sección, véase attributes(7).

       ┌───────────────────────────────────────────────────────────────┬────────────────────┬───────────────────┐
       │InterfazAtributoValor             │
       ├───────────────────────────────────────────────────────────────┼────────────────────┼───────────────────┤
       │clock()                                                        │ Seguridad del hilo │ Multi-hilo seguro │
       └───────────────────────────────────────────────────────────────┴────────────────────┴───────────────────┘

ESTÁNDARES

       POSIX.1-2001,  POSIX.1-2008,  C99.   XSI  requires  that CLOCKS_PER_SEC equals 1000000 independent of the
       actual resolution.

NOTAS

       El C estándar permite que la función devuelva valores arbitrarios al  comienzo  del  programa.  Reste  el
       valor devuelto por una llamada clock() al comienzo del programa para obtener la máxima portabilidad.

       Dese  cuenta que el tiempo puede volver a ser 0. En un sistema de 32 bits donde CLOCKS_PER_SEC es igual a
       1000000, esta función devolverá el mismo valor cada 72 minutos, aproximadamente.

       On several other implementations, the value returned by clock()  also includes the times of any  children
       whose  status  has  been  collected via wait(2)  (or another wait-type call).  Linux does not include the
       times of waited-for children in the value returned by clock().  The times(2) function,  which  explicitly
       returns (separate) information about the caller and its children, may be preferable.

       In  glibc  2.17  and  earlier, clock()  was implemented on top of times(2).  For improved accuracy, since
       glibc 2.18, it is implemented on top of clock_gettime(2)  (using the CLOCK_PROCESS_CPUTIME_ID clock).

VÉASE TAMBIÉN

       clock_gettime(2), getrusage(2), times(2)

TRADUCCIÓN

       La  traducción  al  español  de  esta   página   del   manual   fue   creada   por   Sebastian   Desimone
       <chipy@argenet.com.ar>,  Rafael  Rios  <rafarios@arrakis.es>, Juan Piernas <piernas@ditec.um.es> y Miguel
       Pérez Ibars <mpi79470@alu.um.es>

       Esta  traducción  es   documentación   libre;   lea   la   GNU   General   Public   License   Version   3
       ⟨https://www.gnu.org/licenses/gpl-3.0.html⟩  o posterior con respecto a las condiciones de copyright.  No
       existe NINGUNA RESPONSABILIDAD.

       Si encuentra algún error en la traducción de esta página  del  manual,  envíe  un  correo  electrónico  a
       ⟨debian-l10n-spanish@lists.debian.org⟩.