time_mes.hpp 253 B

12345678910
  1. #ifndef TIME_MES_HPP
  2. #define TIME_MES_HPP
  3. #include <sys/time.h>
  4. // renvoit l'heure en secondes (pécision : micro seconde)
  5. double get_time() {
  6. struct timeval tv;
  7. gettimeofday(&tv,0);
  8. return static_cast<double>(tv.tv_sec+tv.tv_usec*1e-6);
  9. }
  10. #endif