time_mes.hpp 292 B

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