gochatai/pachi_py/pachi/timeinfo.c
/* Sleep for a given interval (in seconds). Return immediately if interval < 0. */
Sleep for a given interval (in seconds). Return immediately if interval < 0.
Sleep for a given interval ( in seconds ) . Return immediately if interval < 0 .
void
time_sleep(double interval)
{
#ifdef _WIN32
	unsigned int t = interval * 1000.0;
	Sleep(t);
#else
	struct timespec ts;
	double sec;
	ts.tv_nsec = (int)(modf(interval, &sec)*1000000000.0);
        ts.tv_sec = (int)sec;
	nanosleep(&ts, NULL); 
#endif
}
void time_sleep ( double interval ) { #ifdef _WIN32 unsigned int t = interval * 1000.0 ; Sleep ( t ) ; #else struct timespec ts ; double sec ; ts . tv_nsec = ( int ) ( modf ( interval , & sec ) * 1000000000.0 ) ; ts . tv_sec = ( int ) sec ; nanosleep ( & ts , NULL ) ; #endif }
Sleep for a given interval (in seconds).
Sleep for a given interval ( in seconds ) .
/* ignore error if interval was < 0 */