44 #ifndef KOKKOS_TIMER_HPP 45 #define KOKKOS_TIMER_HPP 50 #undef KOKKOS_USE_LIBRT 51 #include <gettimeofday.c> 53 #ifdef KOKKOS_USE_LIBRT 66 #ifdef KOKKOS_USE_LIBRT 67 struct timespec m_old;
69 struct timeval m_old ;
77 #ifdef KOKKOS_USE_LIBRT 78 clock_gettime(CLOCK_REALTIME, &m_old);
80 gettimeofday( & m_old , ((
struct timezone *) NULL ) );
91 double seconds()
const 93 #ifdef KOKKOS_USE_LIBRT 94 struct timespec m_new;
95 clock_gettime(CLOCK_REALTIME, &m_new);
97 return ( (
double) ( m_new.tv_sec - m_old.tv_sec ) ) +
98 ( (double) ( m_new.tv_nsec - m_old.tv_nsec ) * 1.0e-9 );
100 struct timeval m_new ;
102 ::gettimeofday( & m_new , ((
struct timezone *) NULL ) );
104 return ( (
double) ( m_new.tv_sec - m_old.tv_sec ) ) +
105 ( (double) ( m_new.tv_usec - m_old.tv_usec ) * 1.0e-6 );