Machine Imagination Technologies
マシン 想像力 テクノロジー

 

Useful Sample C++ Codes

 

estimating time ============
double dtime()
{
#ifdef LINUX
    struct timeval tv;
    gettimeofday(&tv, NULL);
    return ((double)tv.tv_sec + ((double)tv.tv_usec*1.0e-6));
#else //VS studio
    time_t ltime;
    time(&ltime);
    struct timeb tmb;
    ftime(&tmb);
    double sec = (double)(ltime);
    double milisec = (double)tmb.millitm;
    return (sec + milisec/1000); 
#endif
}
============
   
   
   
   
   
   
   
   

 

 

 

Copyright©2016 Machine Imagination Technologies. All rights reserved.