Win32 API 日本語リファレンス
ホームSystem.SystemInformation › GetTickCount64

GetTickCount64

関数
システム起動からの経過ミリ秒数を64ビット値で取得する。
DLLKERNEL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// KERNEL32.dll
#include <windows.h>

ULONGLONG GetTickCount64(void);

パラメーターなし。戻り値: ULONGLONG

各言語での呼び出し定義

// KERNEL32.dll
#include <windows.h>

ULONGLONG GetTickCount64(void);
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern ulong GetTickCount64();
<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function GetTickCount64() As ULong
End Function
Declare PtrSafe Function GetTickCount64 Lib "kernel32" () As LongLong
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetTickCount64 = ctypes.windll.kernel32.GetTickCount64
GetTickCount64.restype = ctypes.c_ulonglong
GetTickCount64.argtypes = []
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('KERNEL32.dll')
GetTickCount64 = Fiddle::Function.new(
  lib['GetTickCount64'],
  [],
  -Fiddle::TYPE_LONG_LONG)
#[link(name = "kernel32")]
extern "system" {
    fn GetTickCount64() -> u64;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("KERNEL32.dll")]
public static extern ulong GetTickCount64();
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_GetTickCount64' -Namespace Win32 -PassThru
# $api::GetTickCount64()
#uselib "KERNEL32.dll"
#func global GetTickCount64 "GetTickCount64"
; GetTickCount64   ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "KERNEL32.dll"
#cfunc global GetTickCount64 "GetTickCount64"
; res = GetTickCount64()
; ULONGLONG GetTickCount64()
#uselib "KERNEL32.dll"
#cfunc global GetTickCount64 "GetTickCount64"
; res = GetTickCount64()
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procGetTickCount64 = kernel32.NewProc("GetTickCount64")
)

r1, _, err := procGetTickCount64.Call()
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // ULONGLONG
function GetTickCount64: UInt64; stdcall;
  external 'KERNEL32.dll' name 'GetTickCount64';
result := DllCall("KERNEL32\GetTickCount64", "Int64")
●GetTickCount64() = DLL("KERNEL32.dll", "qword GetTickCount64()")
# 呼び出し: GetTickCount64()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。