* 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:
akr 2013-08-11 02:59:30 +00:00
parent 2e04bc776c
commit 93bb48995c
5 changed files with 230 additions and 4 deletions

View file

@ -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