Espaços nominais
Variantes
Acções

clock

Da cppreference.com
< c‎ | chrono

 
 
Utilitários de data e hora
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação do tempo
Original:
Time manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
difftime
time
clock
Conversões de formato
Original:
Format conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
asctime
ctime
strftime
wcsftime
gmtime
localtime
mktime
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CLOCKS_PER_SEC
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tm
time_t
clock_t
 
Defined in header <time.h>
clock_t clock();
Retorna a hora aproximada do processador usado no processo, desde o início de uma era definida pela implementação relacionada com a execução do programa. Para converter o valor resultado para segundo dividir por CLOCKS_PER_SEC. Uma vez que o início da era clock não tem que coincidir com o início do programa, apenas a diferença entre dois valores devolvidos por chamadas para diferentes clock é significativo. Se a CPU é compartilhada por outros processos, o tempo clock pode avançar mais lento do que relógio de parede. Se o processo atual é de vários segmentos e mais de um núcleo de execução está disponível, o tempo clock pode avançar mais rápido do relógio de parede.
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.

Índice

[editar] Parâmetros

(Nenhum)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

Tempo de processador usado pelo programa até agora ou (clock_t)(-1) se que a informação não está disponível.
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.

[editar] Notas

Em POSIX sistemas compatíveis, clock_gettime com relógio ID CLOCK_PROCESS_CPUTIME_ID oferece melhor resolução.
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.
O valor retornado por clock() pode envolver em torno de algumas implementações. Por exemplo, em uma máquina com 32-bit clock_t, envolve depois 2,147 segundo ou 36 minutos.
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.
clock() não é necessário para 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.

[editar] Exemplo

[editar] Veja também

converte um objeto tm a uma representação textual
Original:
converts a tm object to a textual representation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
retorna o tempo atual do sistema como o tempo 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.

(função) [edit]