mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Trying to fix time and platforms
This commit is contained in:
@@ -3,30 +3,7 @@
|
|||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include "toy_common.h"
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
//using time.h
|
|
||||||
var timer: opaque = startTimer();
|
|
||||||
var diff: opaque = timer.stopTimer();
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
var timer = createTimer(seconds, microseconds);
|
|
||||||
print timer.getTimerSeconds();
|
|
||||||
print timer.getTimerMicroseconds();
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
var diff: opaque = timer.compareTimers(rhs); //expects another timer
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
print timer.timerToString(); //string representation of the timer
|
|
||||||
|
|
||||||
timer.destroyTimer(); //needed to free the memory
|
|
||||||
*/
|
|
||||||
|
|
||||||
//god damn it
|
//god damn it
|
||||||
static struct timeval* diff(struct timeval* lhs, struct timeval* rhs) {
|
static struct timeval* diff(struct timeval* lhs, struct timeval* rhs) {
|
||||||
|
|||||||
@@ -12,8 +12,17 @@
|
|||||||
//platform exports/imports
|
//platform exports/imports
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#define TOY_API extern
|
#define TOY_API extern
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
#elif defined(_WIN32) || defined(WIN32)
|
||||||
|
#define TOY_API
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define TOY_API
|
#define TOY_API
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TOY_EXPORT
|
#ifndef TOY_EXPORT
|
||||||
|
|||||||
Reference in New Issue
Block a user