mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-29 13:26:45 -04:00
All implementations of these functions are identical. Follow CL 30819 which did the same for syscall. Change-Id: I3c78f05ea12251306f3e100a006d266154a5238e Reviewed-on: https://go-review.googlesource.com/72378 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
16 lines
606 B
Go
16 lines
606 B
Go
// Copyright 2017 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
|
|
|
package unix
|
|
|
|
// TimespecToNsec converts a Timespec value into a number of
|
|
// nanoseconds since the Unix epoch.
|
|
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
|
|
// TimevalToNsec converts a Timeval value into a number of nanoseconds
|
|
// since the Unix epoch.
|
|
func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }
|