Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.18 KB

File metadata and controls

48 lines (37 loc) · 1.18 KB

Home

Retrieving the System Time adjustment

Code:

DECLARE INTEGER GetLastError IN kernel32

	DECLARE SHORT GetSystemTimeAdjustment IN kernel32.dll;
		INTEGER @ lpTimeAdjustment,;
		INTEGER @ lpTimeIncrement,;
		SHORT   @ lpTimeAdjustmentDisabled

	STORE 0 TO lpTimeAdjustment, lpTimeIncrement,;
		lpTimeAdjustmentDisabled

	IF GetSystemTimeAdjustment (@lpTimeAdjustment,;
		@lpTimeIncrement, @lpTimeAdjustmentDisabled) = 1

		? "The time adjustment is: " +;
			Iif(lpTimeAdjustmentDisabled=0, "ENABLED", "disabled")
		?
		? "The number of 100-nanosecond units "
		? "added to the time-of-day clock "
		? "at each periodic time adjustment: "
		?? lpTimeAdjustment
		?
		? "The interval, "
		? "counted in 100-nanosecond units, "
		? "between periodic time adjustments: "
		?? lpTimeIncrement
	ELSE
		? "GetSystemTimeAdjustment calling error: "
		?? GetLastError()
	ENDIF  

Listed functions:

GetLastError
GetSystemTimeAdjustment

Comment:

WinNT only. This function is not supported under Win9*