Ruby에서 현재 창 TickCount를 가져올 수 있습니까?Ruby의 Windows GetTickCount
(http://msdn.microsoft.com/en-us/library/ms724408%28v=vs.85%29.aspx)
Ruby에서 현재 창 TickCount를 가져올 수 있습니까?Ruby의 Windows GetTickCount
(http://msdn.microsoft.com/en-us/library/ms724408%28v=vs.85%29.aspx)
예, 그것은 예를 들어 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
사용 윈도우 API : 기계가있을 때
require 'Win32API'
t = Win32API.new("kernel32", "GetTickCount", nil, 'L')
t.call()
또는 Time.now - t.call()/1000.0
이 시간을 얻을 수를 부팅 된