Getting time in linux with pure C

Started by
1 comment, last by Steamrunner 21 years, 4 months ago
Hello, How do I get miliseconds in a Linux OS using only C. I want a program to block 0.5 sec then it will listen for an user input. Thanks
Advertisement
just delete the other post (using the ''did you double post'' checkbox) and the thread will disappear
1) ANSI clock(): CPU time used so far (divide by frequency = CLOCKS_PER_SEC)
2) POSIX.1 sleep(): blocks the program x seconds
3) BSD gettimeofday: second/microsecond timer
4) SDL SDL_GetTicks: millisecond counter

HTH
Jan
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3

This topic is closed to new replies.

Advertisement