In tracking down a problem in Simutrans-Extended (see here (https://forum.simutrans.com/index.php?topic=17614.msg168707#msg168707) for the discussion), I have found a bug which also applies to Standard: the dr_sleep() function is denominated in seconds, rather than milliseconds, when a non-Windows posix backend is used. Below is a fix, which should replace the code in simsys_posix.cc at dr_sleep:
void dr_sleep(uint32 msec)
{
/*
// this would be 100% POSIX but is usually not very accurate ...
if( msec>0 ) {
struct timeval tv;
tv.sec = 0;
tv.usec = msec*1000;
select(0, 0, 0, 0, &tv);
}
*/
#ifdef _WIN32
Sleep( msec );
#else
usleep( msec * 1000u );
#endif
}
That could result in a long wait indeed! Good thing sleeping is not used in network mode...
Thanks for reporting. This is now fixed in r8376