Whoops, accidentally deleted my comment from before. If we don't accept the larger change which eliminates it, I believe there's a bug in this code. It should be:

```
if (result.tv_nsec < 0) {
    result.tv_nsec = 1e9 + result.tv_nsec;
    result.tv_sec -= 1;
}
```

The tv_nsec field is negative already, so you want to add it to 1e9 rather than subtracting it.