example.cpp 496 B

123456789101112131415161718192021222324
  1. #include <igl/get_seconds.h>
  2. #include <cstdio>
  3. #include <cmath>
  4. int main(int argc, char * argv[])
  5. {
  6. using namespace igl;
  7. using namespace std;
  8. double start = get_seconds();
  9. printf("start: %lgs\n",start);
  10. double lap = start;
  11. double now;
  12. do
  13. {
  14. now = get_seconds();
  15. if((now-lap)>=1.0)
  16. {
  17. printf("%lgs - %lgs = %lgs\n",now,start,now-start);
  18. lap = now-((now-start)-floor(now-start));
  19. }
  20. }while((now - start)<10.0);
  21. printf("end: %lgs\n",now);
  22. return 0;
  23. }