ホーム › System.SystemInformation › GetTickCount
GetTickCount
関数システム起動からの経過ミリ秒数を取得する。
シグネチャ
// KERNEL32.dll
#include <windows.h>
DWORD GetTickCount(void);パラメーターなし。戻り値: DWORD
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
DWORD GetTickCount(void);[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern uint GetTickCount();<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function GetTickCount() As UInteger
End FunctionDeclare PtrSafe Function GetTickCount Lib "kernel32" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetTickCount = ctypes.windll.kernel32.GetTickCount
GetTickCount.restype = wintypes.DWORD
GetTickCount.argtypes = []require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
GetTickCount = Fiddle::Function.new(
lib['GetTickCount'],
[],
-Fiddle::TYPE_INT)#[link(name = "kernel32")]
extern "system" {
fn GetTickCount() -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("KERNEL32.dll")]
public static extern uint GetTickCount();
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_GetTickCount' -Namespace Win32 -PassThru
# $api::GetTickCount()#uselib "KERNEL32.dll"
#func global GetTickCount "GetTickCount"
; GetTickCount ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global GetTickCount "GetTickCount"
; res = GetTickCount(); DWORD GetTickCount()
#uselib "KERNEL32.dll"
#cfunc global GetTickCount "GetTickCount"
; res = GetTickCount()import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procGetTickCount = kernel32.NewProc("GetTickCount")
)
r1, _, err := procGetTickCount.Call()
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction GetTickCount: DWORD; stdcall;
external 'KERNEL32.dll' name 'GetTickCount';result := DllCall("KERNEL32\GetTickCount", "UInt")●GetTickCount() = DLL("KERNEL32.dll", "dword GetTickCount()")
# 呼び出し: GetTickCount()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。