Risky101
asked on
difftime() seems to have a resolution of 1 second - anything more accurate?
Hi,
Difftime seems to have a resolution of 1 second, ie:
//
// Profiling: output time since last operation
//
{
time(&profiling_now);
time_t td;
td=difftime(profiling_now, profiling_then);
td=(float)td;
my_fprintf_VL7(stderr,"[t2 =%2.3fs]", td);
time(&profiling_then);
}
... prints things like [t2=1.000s] or [t2=3.000s].
Any calls in the Linux 2.6 kernel that can get a resolution down to 1/100 of a second? This excludes driver calls - this is an application.
Shane.
Difftime seems to have a resolution of 1 second, ie:
//
// Profiling: output time since last operation
//
{
time(&profiling_now);
time_t td;
td=difftime(profiling_now,
td=(float)td;
my_fprintf_VL7(stderr,"[t2
time(&profiling_then);
}
... prints things like [t2=1.000s] or [t2=3.000s].
Any calls in the Linux 2.6 kernel that can get a resolution down to 1/100 of a second? This excludes driver calls - this is an application.
Shane.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The macro timersub defined in sys/time.h performs substractions of timeval structure variables