2002-11-22 19:31:44 +00:00
|
|
|
/*
|
2018-08-15 15:59:11 +02:00
|
|
|
** gettime.c
|
2014-06-30 05:10:35 -04:00
|
|
|
**
|
|
|
|
** Maciej 'YTM/Elysium' Witkowiak, 22.11.2002
|
|
|
|
*/
|
2002-11-22 19:31:44 +00:00
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
#include <geos.h>
|
|
|
|
|
2018-08-15 15:59:11 +02:00
|
|
|
clock_t clock(void)
|
2012-02-08 16:56:54 +00:00
|
|
|
{
|
|
|
|
struct tm currentTime;
|
2002-11-22 19:31:44 +00:00
|
|
|
|
|
|
|
currentTime.tm_sec = system_date.s_seconds;
|
|
|
|
currentTime.tm_min = system_date.s_minutes;
|
|
|
|
currentTime.tm_hour = system_date.s_hour;
|
|
|
|
currentTime.tm_mday = system_date.s_day;
|
|
|
|
currentTime.tm_mon = system_date.s_month;
|
|
|
|
currentTime.tm_year = system_date.s_year;
|
|
|
|
if (system_date.s_year < 87) {
|
2013-05-09 13:56:54 +02:00
|
|
|
currentTime.tm_year+=100;
|
2002-11-22 19:31:44 +00:00
|
|
|
}
|
|
|
|
currentTime.tm_isdst = -1;
|
|
|
|
|
|
|
|
return mktime(¤tTime);
|
|
|
|
}
|
|
|
|
|
2018-08-15 15:59:11 +02:00
|
|
|
int clock_gettime(clockid_t, struct timespec *tp)
|
2012-02-08 16:56:54 +00:00
|
|
|
{
|
2018-08-15 15:59:11 +02:00
|
|
|
tp->tv_sec = clock();
|
|
|
|
tp->tv_nsec = 0;
|
|
|
|
|
|
|
|
return 0;
|
2005-07-17 11:59:46 +00:00
|
|
|
}
|