8 if JRuby::FFI::Platform::IS_WINDOWS
9 attach_function :_getpid, :getpid, [], :pid_t
11 attach_function :getpid, [], :pid_t
16 puts "pid=#{Process.pid} Foo.getpid=#{Posix.getpid}"
17 puts "Benchmark FFI getpid performance, #{iter}x calls"
21 puts Benchmark.measure {
22 iter.times { Posix.getpid }
25 puts "Benchmark Process.pid performance, #{iter}x calls"
27 puts Benchmark.measure {
28 iter.times { Process.pid }