example.cpp 493 B

12345678910111213141516171819202122232425
  1. #include <cstdio>
  2. #include <igl/get_seconds.h>
  3. using namespace igl;
  4. #include <cmath>
  5. using namespace std;
  6. int main(int argc, char * argv[])
  7. {
  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. }