clock
De cppreference.com
![]() |
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
Definido en el archivo de encabezado <time.h>
|
||
clock_t clock(); |
||
Devuelve el tiempo aproximado que se utiliza el procesador por el proceso desde el comienzo de una era definida por la aplicación relacionada con la ejecución del programa. Para convertir el valor en segundos resultado lo dividimos por CLOCKS_PER_SEC. Debido a que el principio de la era clock no tiene por qué coincidir con el inicio del programa, sólo la diferencia entre dos valores devueltos por las llamadas a diferentes clock es significativa. Si la CPU es compartida por otros procedimientos, tiempo clock puede avanzar más lento que el reloj de pared. Si el proceso actual es multiproceso y más de un núcleo de ejecución está disponible, el tiempo clock puede avanzar más rápido que el reloj de la pared .
Original:
Returns the approximate processor time used by the process since the beginning of an implementation-defined era related to the program's execution. To convert result value to seconds divide it by CLOCKS_PER_SEC. Because the beginning of the clock era does not have to coincide with the start of the program, only the difference between two values returned by different calls to clock is meaningful. If the CPU is shared by other processes, clock time may advance slower than wall clock. If the current process is multithreaded and more than one execution core is available, clock time may advance faster than wall clock.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Contenido |
[editar] Parámetros
(Ninguno)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar] Valor de retorno
Tiempo de procesador utilizado por el programa hasta la fecha o (clock_t)(-1) si esa información no está disponible .
Original:
Processor time used by the program so far or (clock_t)(-1) if that information is unavailable.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar] Notas
En sistemas compatibles con POSIX, clock_gettime con id reloj CLOCK_PROCESS_CPUTIME_ID ofrece una mejor resolución .
Original:
On POSIX-compatible systems, clock_gettime with clock id CLOCK_PROCESS_CPUTIME_ID offers better resolution.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
El valor devuelto por
clock()
puede envolver en algunas implementaciones. Por ejemplo, en una máquina con 32-bit clock_t, se envuelve después de 2147 segundos o minutos 36 .Original:
The value returned by
clock()
may wrap around on some implementations. For example, on a machine with 32-bit clock_t, it wraps after 2147 seconds or 36 minutes.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
clock()
no está obligado a ser thread-safe .Original:
clock()
is not required to be thread-safe.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[editar] Ejemplo
Esta sección está incompleta Razón: sin ejemplo |
[editar] Ver también
convierte un objeto tm a una representación textualOriginal: converts a tm object to a textual representationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
devuelve la hora actual del sistema como el tiempo desde época Original: returns the current time of the system as time since epoch The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función) | |
Documentación de C++ para clock
|