diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-11 02:59:30 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-08-11 02:59:30 +0000 |
commit | 93bb48995c17f81b00140f157a642ece3eef627b (patch) | |
tree | 5adb957202404abb76f1bfd19c78cdc11d6b682e /test | |
parent | 2e04bc776cdd8007db972bdc6df4ca3361acf467 (diff) | |
download | ruby-93bb48995c17f81b00140f157a642ece3eef627b.tar.gz |
* 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
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 9c764925d8..2e7f3a45f3 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -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 |