mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 18:43:59 +02:00
* process.c (rb_clock_gettime): New method.
This is accepted in the meeting: https://bugs.ruby-lang.org/projects/ruby/wiki/DevelopersMeeting20130809 This method is accepted as a CRuby feature. I.e. Other Ruby implementations don't need to implement it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2e04bc776c
commit
93bb48995c
5 changed files with 230 additions and 4 deletions
|
@ -1660,4 +1660,13 @@ EOS
|
|||
end
|
||||
end if windows?
|
||||
|
||||
def test_clock_gettime
|
||||
t1 = Process.clock_gettime(Process::CLOCK_REALTIME, :nanoseconds)
|
||||
t2 = Time.now; t2 = t2.tv_sec * 1000000000 + t2.tv_nsec
|
||||
t3 = Process.clock_gettime(Process::CLOCK_REALTIME, :nanoseconds)
|
||||
assert_operator(t1, :<=, t2)
|
||||
assert_operator(t2, :<=, t3)
|
||||
assert_raise(Errno::EINVAL) { Process.clock_gettime(:foo) }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue