socket :: NativeTimeval :: defaultinit
# Time structure, with a microsecond resolution
extern class NativeTimeval `{ struct timeval* `}
new (seconds: Int, microseconds: Int) `{
struct timeval* tv = NULL;
tv = malloc(sizeof(struct timeval));
tv->tv_sec = seconds;
tv->tv_usec = microseconds;
return tv;
`}
# Number of seconds recorded
fun seconds: Int `{ return self->tv_sec; `}
# Number of microseconds recorded
fun microseconds: Int `{ return self->tv_usec; `}
# Destory `self`
fun destroy `{ free(self); `}
end
lib/socket/socket_c.nit:349,1--367,3