mirror of https://github.com/YosysHQ/abc.git
Updating command "time" to report wall time.
This commit is contained in:
parent
a4755a37cb
commit
6d866dab6b
|
|
@ -394,9 +394,17 @@ ABC_NAMESPACE_IMPL_START
|
||||||
|
|
||||||
double Extra_CpuTimeDouble()
|
double Extra_CpuTimeDouble()
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
struct rusage ru;
|
struct rusage ru;
|
||||||
getrusage(RUSAGE_SELF, &ru);
|
getrusage(RUSAGE_SELF, &ru);
|
||||||
return (double)ru.ru_utime.tv_sec + (double)ru.ru_utime.tv_usec / 1000000;
|
return (double)ru.ru_utime.tv_sec + (double)ru.ru_utime.tv_usec / 1000000;
|
||||||
|
*/
|
||||||
|
struct timespec ts;
|
||||||
|
if ( clock_gettime(CLOCK_MONOTONIC, &ts) < 0 )
|
||||||
|
return (double)-1;
|
||||||
|
double res = ((double) ts.tv_sec);
|
||||||
|
res += ((double) ts.tv_nsec) / 1000000000;
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue