3
Contributors
2
Replies
5
Views
9 Years
Discussion Span
Last Post by ArkM
0

Im guessing you mean in relation to realy time, you may want to use CLOCKS_PER_SEC to get things in terms of time and in terms of time to clocks for example divide clock()/CLOCKS_PER_SEC withh give you how many seconds, etc and if you want to wait for x seconds do seconds*CLOCKS_PER_SEC

Chris

0

What is a clock tick equal to in ctime??

The time_t type is an implementation-defined arithmetic type capable of representing times. Use difftime function to get the difference between two times of type time_t in seconds as a double value:

#include <time.h>
...
    time_t t;
    time(&t);
    printf("time_t step %f sec\n",difftime(t+1,t)); // time_t precision

As usually, it's equal to 1 sec (but it's not the language standard requirement).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.