mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 18:43:59 +02:00
* process.c (rb_clock_gettime): Strip "s" from unit names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3873e09cad
commit
a641003f66
3 changed files with 18 additions and 14 deletions
|
@ -1661,9 +1661,9 @@ EOS
|
|||
end if windows?
|
||||
|
||||
def test_clock_gettime
|
||||
t1 = Process.clock_gettime(Process::CLOCK_REALTIME, :nanoseconds)
|
||||
t1 = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
|
||||
t2 = Time.now; t2 = t2.tv_sec * 1000000000 + t2.tv_nsec
|
||||
t3 = Process.clock_gettime(Process::CLOCK_REALTIME, :nanoseconds)
|
||||
t3 = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
|
||||
assert_operator(t1, :<=, t2)
|
||||
assert_operator(t2, :<=, t3)
|
||||
assert_raise(Errno::EINVAL) { Process.clock_gettime(:foo) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue