Commit 74dada66 authored by BRAMAS Berenger's avatar BRAMAS Berenger

update timer for ftic to clock_gettime

parent baeaf826
......@@ -45,8 +45,9 @@ OPTION( ScalFMM_USE_DOUBLE_PRECISION "Set to ON to compile in double precision"
OPTION( ScalFMM_ATTACHE_SOURCE "Set to ON to compile with -g" OFF )
OPTION( ScalFMM_USE_ADDONS "Set to ON to compile add ons" OFF )
OPTION( ScalFMM_USE_SSE "Set to ON to compile with sse support" ON )
#
SET(SCALFMM_LIBRARIES "")
# Set scalfmm to default libraries
SET(SCALFMM_LIBRARIES "-lrt")
# Test if openmp is here
find_package (OpenMP)
......
......@@ -97,9 +97,10 @@ public:
#ifdef WINDOWS
return static_cast<double>(GetTickCount())/1000.0;
#else // We are in linux/posix
timeval t;
gettimeofday(&t, NULL);
return double(t.tv_sec) + (double(t.tv_usec)/1000000.0);
// better than gettimeofday but need -lrt
struct timespec tp;
clock_gettime(CLOCK_MONOTONIC_RAW, &tp);
return double(tp.tv_sec) + (double(tp.tv_nsec)/1000000000.0);
#endif
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment