Sha256: eb0aa8ac4394f7d4fad2a4e68f90f772a71ee7f548eae076aa019812c2fe659d
Contents?: true
Size: 581 Bytes
Versions: 46
Compression:
Stored size: 581 Bytes
Contents
#include <Gosu/Timing.hpp> #include <unistd.h> #include <sys/time.h> void Gosu::sleep(unsigned milliseconds) { usleep(milliseconds * 1000); } unsigned long Gosu::milliseconds() { static unsigned long start = 0; timeval tp; gettimeofday(&tp, NULL); 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; }
Version data entries
46 entries across 46 versions & 1 rubygems