Dave.
Not here.
(i and j will of course be ==; they're a conversion of the
same time to a unix-nanoseconds-count.)
Chris
--
Chris "allusive" Dollin
Wait, that's not it. You're never changing the 't' variable after init.
> I ran this code with 2 seconds of sleeping on a real machine. FBSD 9.0
> amd 64. Latest weekly i just rebuilt my $GOROOT/src
>
> According to http://weekly.golang.org/pkg/time/#Time.UnixNano
>
> It returns the number of nano since epoch. This should change after
> sleeping for 2 seconds for sure.
UnixNano is a method on an object. If you don't change the object, it
will report the same value each call.
Read the docs more carefully: t.UnixNano() is the number of
nanoseconds since epoch of *that* time, not of the current time. You
need to call time.Now().UnixNano() to get the current value.
>
> It doesn't on my system.
For clarity, please paste the *exact* code you are using.
> Just re read them. To quote : UnixNano returns the Unix time, the
> number of nanoseconds elapsed since January 1, 1970 UTC.
>
> How does that tell me is for the receiver t without looking at the
> source ?
>
> I suppose one can argue that since the receiver is t, it would make
> sense.
>
> I'll try not to post silly questions without looking at the source,
> but I wanted to clarify that the docs didn't read clear to me.
You're right, it could be clearer. The other methods refer to the
receiver t, but Unix/UnixNano don't. Can you please file a bug?
http://code.google.com/p/go/issues/list
Dave.