- fun -(other: Timespec): Timespec
- do
- var s = sec - other.sec
- var ns = nanosec - other.nanosec
- if ns < 0 then
- s -= 1
- ns += 1000000000
- end
- return new Timespec(s, ns)
- end
+ fun -(other: Timespec): Timespec `{
+ time_t s = self->tv_sec - other->tv_sec;
+ long ns = self->tv_nsec - other->tv_nsec;
+ if (ns < 0) {
+ s -= 1;
+ ns += 1000000000l;
+ }
+ struct timespec* tv = malloc(sizeof(struct timespec));
+ tv->tv_sec = s; tv->tv_nsec = ns;
+ return tv;
+ `}