るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.026秒)
トップページ > クエリ:time[x] > バージョン:2.3.0[x] > クラス:Time[x] > クエリ:local[x] > クエリ:tv_nsec[x]

別のキーワード

  1. socket local_creds
  2. socket local_peercred
  3. socket local_connwait
  4. socket af_local
  5. socket pf_local

ライブラリ

検索結果

Time#tv_nsec -> Integer (72361.0)

時刻のナノ秒の部分を整数で返します。

...部分を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p "%10.9f" % t.to_f # => "946749845.000005960"
p t.nsec # => 6000
//}

IEEE 754 浮動小数点数で表現できる精度が違うため、Time#to_fの最小
の桁とnsecの最小の桁は異なり...

Time#nsec -> Integer (27061.0)

時刻のナノ秒の部分を整数で返します。

...部分を整数で返します。

//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5,6)
p "%10.9f" % t.to_f # => "946749845.000005960"
p t.nsec # => 6000
//}

IEEE 754 浮動小数点数で表現できる精度が違うため、Time#to_fの最小
の桁とnsecの最小の桁は異なり...