Converts a timespec to an absl::Duration.
Some APIs use a timespec or a timeval as a Duration (e.g., nanosleep(2) and select(2)), while others use them as a Time (e.g. clock_gettime(2) and gettimeofday(2)), so conversion functions are provided for both cases. The "to timespec/val" direction is easily handled via overloading, but for "from timespec/val" the desired type is part of the function name.
The equivalent duration.
| Name | Description |
|---|---|
| ts | The timespec to convert. |