2019-10-30 13:07:32 +03:00
|
|
|
void System_free(void *p) {
|
|
|
|
CARP_FREE(p);
|
|
|
|
}
|
2018-01-24 17:53:18 +03:00
|
|
|
|
2019-10-30 13:07:32 +03:00
|
|
|
int System_time() {
|
|
|
|
return time(0);
|
|
|
|
}
|
2018-01-24 17:53:18 +03:00
|
|
|
|
2019-03-05 17:03:18 +03:00
|
|
|
#ifdef _WIN32
|
|
|
|
void System_sleep_MINUS_seconds(int t) {
|
|
|
|
// TODO!
|
|
|
|
}
|
|
|
|
|
|
|
|
void System_sleep_MINUS_micros(int t) {
|
|
|
|
// TODO!
|
|
|
|
}
|
|
|
|
|
2019-10-30 13:07:32 +03:00
|
|
|
double System_nanotime() {
|
|
|
|
return 0;
|
|
|
|
}
|
2019-03-05 17:03:18 +03:00
|
|
|
#else
|
2019-10-30 13:07:32 +03:00
|
|
|
void System_sleep_MINUS_seconds(int t) {
|
|
|
|
sleep(t);
|
|
|
|
}
|
2018-01-24 17:53:18 +03:00
|
|
|
|
2019-10-30 13:07:32 +03:00
|
|
|
void System_sleep_MINUS_micros(int t) {
|
|
|
|
usleep(t);
|
|
|
|
}
|
2018-10-19 11:31:00 +03:00
|
|
|
|
|
|
|
double System_nanotime() {
|
2019-10-30 10:47:36 +03:00
|
|
|
struct timespec tv;
|
|
|
|
clock_gettime(CLOCK_REALTIME, &tv);
|
|
|
|
return 1000000000 * tv.tv_sec + tv.tv_nsec;
|
2018-10-19 11:31:00 +03:00
|
|
|
}
|
2019-03-05 17:03:18 +03:00
|
|
|
#endif
|
2018-10-19 11:31:00 +03:00
|
|
|
|
2020-05-08 22:17:25 +03:00
|
|
|
int System_system(const String *command) {
|
|
|
|
return system(*command);
|
2019-10-30 13:07:32 +03:00
|
|
|
}
|
2018-04-04 10:00:20 +03:00
|
|
|
|
|
|
|
Array System_args;
|