]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: document Time{spec,val} methods
authorTobias Klauser <tklauser@distanz.ch>
Thu, 26 Oct 2017 08:10:25 +0000 (10:10 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Fri, 27 Oct 2017 07:18:47 +0000 (07:18 +0000)
Add godoc comments for Time{spec,val} methods Unix and Nano.

Change-Id: I285bbd236af588b30140db7182b05f8b202b5b0b
Reviewed-on: https://go-review.googlesource.com/73271
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/syscall/syscall.go

index 1340f2aa00864e35a249f8ecdc395a4e9be3e3ea..01ba64819da40aeba120f87112a540a39a1b38ee 100644 (file)
@@ -80,18 +80,24 @@ func BytePtrFromString(s string) (*byte, error) {
 // See mksyscall.pl.
 var _zero uintptr
 
+// Unix returns ts as the number of seconds and nanoseconds elapsed since the
+// Unix epoch.
 func (ts *Timespec) Unix() (sec int64, nsec int64) {
        return int64(ts.Sec), int64(ts.Nsec)
 }
 
+// Unix returns tv as the number of seconds and nanoseconds elapsed since the
+// Unix epoch.
 func (tv *Timeval) Unix() (sec int64, nsec int64) {
        return int64(tv.Sec), int64(tv.Usec) * 1000
 }
 
+// Nano returns ts as the number of nanoseconds elapsed since the Unix epoch.
 func (ts *Timespec) Nano() int64 {
        return int64(ts.Sec)*1e9 + int64(ts.Nsec)
 }
 
+// Nano returns tv as the number of nanoseconds elapsed since the Unix epoch.
 func (tv *Timeval) Nano() int64 {
        return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
 }