syscall: Update documented syscall.Timeval units #43010
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I was trying to check the CPU time used by my program using syscall.Getrusage() and syscall.Rusage.Timeval.Nano().
Example code:
Link to playground: https://play.golang.org/p/-HYHrxvlzwv
What did you expect to see?
I expected the output of use.Utime.Nano() and use.Stime.Nano() to be in units of "nanoseconds elapsed since the Unix epoch" as the documentation states.
What did you see instead?
Instead, I think the results are just the nanoseconds of CPU time used, not nanoseconds since the Unix epoch. That seems to be how the underlying system calls work anyway, so I think the documentation just needs to be updated.
The text was updated successfully, but these errors were encountered: