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
Closed

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

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

Comments

@hanwen
Copy link
Contributor

@hanwen hanwen 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
Copy link
Contributor

@rsc rsc commented Dec 9, 2011

Comment 1:

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

@rsc
Copy link
Contributor

@rsc rsc commented Dec 12, 2011

Comment 2:

Labels changed: added priority-go1.

@davecheney
Copy link
Contributor

@davecheney davecheney commented Dec 17, 2011

Comment 3:

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

@rsc rsc 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
Copy link
Contributor

@robpike robpike commented Dec 20, 2011

Comment 5:

Status changed to Retracted.

@rsc
Copy link
Contributor

@rsc rsc 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
Copy link
Contributor

@robpike robpike commented Dec 21, 2011

Comment 7:

Timespec too, presumably.
@rsc
Copy link
Contributor

@rsc rsc commented Dec 21, 2011

Comment 8:

sgtm
@robpike
Copy link
Contributor

@robpike robpike commented Jan 13, 2012

Comment 9:

Owner changed to builder@golang.org.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jan 19, 2012

Comment 10:

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

Owner changed to @bradfitz.

Status changed to Started.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jan 19, 2012

Comment 11:

This issue was closed by revision 7d418ae.

Status changed to Fixed.

@hanwen
Copy link
Contributor Author

@hanwen hanwen 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
Copy link
Contributor

@rsc rsc 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
Copy link
Contributor

@rsc rsc 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.