Sha256: 7386a73e8d0f1fd8cc43210920abe9df698d3ead58c65b8e229113393083dfa2
Contents?: true
Size: 663 Bytes
Versions: 16
Compression:
Stored size: 663 Bytes
Contents
#include <Gosu/Platform.hpp> #if defined(GOSU_IS_X) #include <Gosu/Timing.hpp> #include <sys/time.h> #include <unistd.h> void Gosu::sleep(unsigned milliseconds) { usleep(milliseconds * 1000); } unsigned long Gosu::milliseconds() { static unsigned long start = 0; timeval tp; gettimeofday(&tp, nullptr); if (!start) { start = tp.tv_usec / 1000UL + tp.tv_sec * 1000UL; } // Truncate to 2^30, C++ users shouldn't mind and Ruby users will // have a happy GC on 32-bit systems. // No, don't ask why this is an unsigned long then :) return (tp.tv_usec / 1000UL + tp.tv_sec * 1000UL - start) & 0x1fffffff; } #endif
Version data entries
16 entries across 16 versions & 1 rubygems