extern int gettimeofday(struct timeval *tv, struct timezone *tz); function psi\gettimeofday(array &$tv = NULL, array &$tz = NULL) : int { let tv = calloc(1, struct timeval); let tz = calloc(1, struct timezone); return to_int(gettimeofday); set $tv = to_array(*tv); set $tz = to_array(*tz); } extern char *asctime(struct tm *tm); function psi\asctime(array $tm = NULL) : string { let tm = arrval($tm); return to_string(asctime); } extern struct tm *gmtime(time_t tp); function psi\gmtime(int $ts) : array { let tp = &intval($ts); return to_array(gmtime); } extern int nanosleep(struct timespec *rqtp, struct timespec *rmtp); function psi\nanosleep(array $rq = NULL, array &$rm = NULL) : int { let rqtp = arrval($rq); let rmtp = calloc(1, struct timespec); return to_int(nanosleep); set $rm = to_array(*rmtp); }