Declaration:
void gettime(int time[]);
Description
Obtains the current computer time. The time information is stored in the time array:
time[0] - hundredths of a second (0...99)
time[1] - seconds (0...59)
time[2] - minutes (0...59)
time[3] - hours (0...23)
Because the gettime function uses the system timer, you may expect a time error of about 52 milliseconds.
Example
int time[4];
while (1)
{
gettime(time);
printf("Time: %d:%d:%d.%d", time[3], time[2], time[1], time[0]);
}
|