C Tutorial/time.h/clock — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
(нет различий)
|
Текущая версия на 13:32, 25 мая 2010
clock
Item Value Header file time.h Declaration clock_t clock(void); Return returns time or -1 if the time is not available.
To transform this value into seconds, divide it by CLOCKS_PER_SEC.
<source lang="cpp">#include <time.h>
#include <stdio.h> int main(void) { printf("Elapsed time: %u secs.\n", clock()/CLOCKS_PER_SEC); }</source>