aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_process.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-11 02:59:30 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-11 02:59:30 +0000
commit93bb48995c17f81b00140f157a642ece3eef627b (patch)
tree5adb957202404abb76f1bfd19c78cdc11d6b682e /test/ruby/test_process.rb
parent2e04bc776cdd8007db972bdc6df4ca3361acf467 (diff)
downloadruby-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/ruby/test_process.rb')
-rw-r--r--test/ruby/test_process.rb9
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