How do I get elapsed time in milliseconds in Ruby?

前端 未结 10 2162
走了就别回头了
走了就别回头了 2020-12-13 05:27

If I have a Time object got from :

Time.now

and later I instantiate another object with that same line, how can I see how many

10条回答
  •  一向
    一向 (楼主)
    2020-12-13 06:04

    I think the answer is incorrectly chosen, that method gives seconds, not milliseconds.

    t = Time.now.t­o_f
    => 1382471965.146
    

    Here I suppose the floating value are the milliseconds

提交回复
热议问题