Commit 51bc2fd7 authored by Victor Yacovlev's avatar Victor Yacovlev

Implemented time function

parent 49a702d2
......@@ -2269,13 +2269,23 @@ public:
inline static int time() { return 0; }
};
#else
#include <time.h>
class System {
public:
inline static void init() {}
inline static void finalize() {}
inline static int time() {
return 0; // TODO implement me
time_t epoch;
struct tm * loc;
epoch = ::time(NULL);
loc = localtime(&epoch);
int result =
loc->tm_hour * 3600 +
loc->tm_min * 60 +
loc->tm_sec;
result *= 1000; // convert s to ms
return result;
}
};
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment