Sha256: c2c581340b6be4d23e0d05a2383cd701bb35e27c8a61760721300b3186efe91c

Contents?: true

Size: 384 Bytes

Versions: 1

Compression:

Stored size: 384 Bytes

Contents

#include <Gosu/Platform.hpp>
#if defined(GOSU_IS_X)

#include <Gosu/Timing.hpp>
#include <sys/time.h>

unsigned long Gosu::milliseconds()
{
    static unsigned long start = 0;

    timeval tp;
    gettimeofday(&tp, nullptr);

    if (start == 0) {
        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-1.4.3 src/TimingUnix.cpp