OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [go/] [os/] [time.go] - Blame information for rev 747

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 747 jeremybenn
// Copyright 2009 The Go Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
 
5
package os
6
 
7
import "syscall"
8
 
9
// Time returns the current time, in whole seconds and
10
// fractional nanoseconds, plus an error if any. The current
11
// time is thus 1e9*sec+nsec, in nanoseconds.  The zero of
12
// time is the Unix epoch.
13
func Time() (sec int64, nsec int64, err error) {
14
        var tv syscall.Timeval
15
        if e := syscall.Gettimeofday(&tv); e != nil {
16
                return 0, 0, NewSyscallError("gettimeofday", e)
17
        }
18
        return int64(tv.Sec), int64(tv.Usec) * 1000, err
19
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.