On 19 March 2013 17:56, headius (Charles Nutter) <headius / headius.com> wrot=
e:
>
> Issue #8096 has been updated by headius (Charles Nutter).
>
>
> A few more thoughts to keep this alive...
>
> Implementation in JRuby:
>
> def Time.timestamp
>   java.lang.System.nano_time / 1000
> end

That seems to work on Linux and some others, but what about Windows?
It likely happens to be clock_gettime() or such in UNIX.

The doc says "This method can only be used to measure elapsed time and
is not related to any other notion of system or wall-clock time."

http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#nanoTime%28%=
29

> There's also currentTimeMillis, but I think providing sub-ms precision is=
 a good idea. =B5s seems sufficient to me.
>
> Definitely would like to see this get into 2.1.
> ----------------------------------------
> Feature #8096: introduce Time.current_timestamp
> https://bugs.ruby-lang.org/issues/8096#change-37740
>
> Author: vipulnsward (Vipul Amler)
> Status: Feedback
> Priority: Low
> Assignee:
> Category:
> Target version:
>
>
> =3Dbegin
> A lot of scenarios and applications require the use of (({Time.now.to_i})=
) which is used as current_timestamp in systems.
>
> The introduction of (({Time.current_timestamp})) {or something with simil=
ar with different name} would provide implicit integer timestamp instead of=
 going from
> (({Time.now})) -> time_object -> to_i -> integer timestamp value
>
> So instead of
>
>  Time.now.to_i # Outputs =3D> 1363274618
>
> one could use
>
>  Time.current_timestamp # Outputs =3D> 1363274618
>
> =3Dend
>
>
>
> --
> http://bugs.ruby-lang.org/
>