Sha256: a9bd76494f4afb2c3ccfe66dc4ba46ea866141749770d535e364fe0ce01c6f67

Contents?: true

Size: 478 Bytes

Versions: 1

Compression:

Stored size: 478 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;
    }

    return tp.tv_usec / 1000UL + tp.tv_sec * 1000UL - start;
}

#endif

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gosu-0.14.0.pre2 src/TimingUnix.cpp