Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: add Nano() int64 method to syscall.Timeval #2534

Closed
hanwen opened this issue Dec 7, 2011 · 14 comments

Comments

Projects
None yet
6 participants
@hanwen
Copy link
Contributor

commented Dec 7, 2011

on weekly.2011-12-02.

The new time package is awesome.  Just a small feature request: the time package could
have a function to convert syscall.Timeval to time.Duration.
@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2011

Comment 1:

Labels changed: added priority-later, removed priority-medium.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 12, 2011

Comment 2:

Labels changed: added priority-go1.

@davecheney

This comment has been minimized.

Copy link
Contributor

commented Dec 17, 2011

Comment 3:

Hello, 
Please take a look at http://golang.org/cl/5489071
@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 17, 2011

Comment 4:

It would be fine to add a Unix() (seconds, nano int64) method to the
Timeval struct directly.  Then you can write
time.Unix(tv.Unix())
@robpike

This comment has been minimized.

Copy link
Contributor

commented Dec 20, 2011

Comment 5:

Status changed to Retracted.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 20, 2011

Comment 6:

I do think we should make the Timevals easier to use.
The Unix method can be passed to time.Unix and is nicer
than the current syscall.TimevalToNsec or whatever it is
called.

Status changed to Accepted.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2011

Comment 7:

Timespec too, presumably.
@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 21, 2011

Comment 8:

sgtm
@robpike

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2012

Comment 9:

Owner changed to builder@golang.org.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jan 19, 2012

Comment 10:

http://golang.org/cl/5554057/

Owner changed to @bradfitz.

Status changed to Started.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jan 19, 2012

Comment 11:

This issue was closed by revision 7d418ae.

Status changed to Fixed.

@hanwen

This comment has been minimized.

Copy link
Contributor Author

commented Feb 3, 2012

Comment 12:

time.Unix(tv.Unix()) works for Time objects, but it doesn't work well if the timeval
represents a duration. Any suggestions for that?
@rsc

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2012

Comment 13:

Forgot that Timevals can represent durations too.  Sigh.

Owner changed to builder@golang.org.

Status changed to Accepted.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Feb 6, 2012

Comment 14:

This issue was closed by revision 32f011e.

Status changed to Fixed.

@hanwen hanwen added fixed labels Feb 6, 2012

@rsc rsc added this to the Go1 milestone Apr 10, 2015

@rsc rsc removed the priority-go1 label Apr 10, 2015

@golang golang locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.