2011-04-14 4 views

답변

1

예, 그것은 예를 들어 FFI 가능합니다. 처음에는 , 당신은 ffi 보석 설치해야합니다

gem install ffi 

를 그리고이 함수에 연결 :

require 'ffi' 
module Foo 
    extend FFI::Library 

    ffi_lib "kernel32.dll" 
    ffi_convention :stdcall 

    attach_function :get_tick_count, :GetTickCount, [ ], :int 
end 
puts Foo.get_tick_count #=> 107073812 
1

사용 윈도우 API : 기계가있을 때

require 'Win32API' 

t = Win32API.new("kernel32", "GetTickCount", nil, 'L') 
t.call() 

또는 Time.now - t.call()/1000.0이 시간을 얻을 수를 부팅 된