■ 현재 시간을 밀리초까지 구하는 방법을 보여준다.
▶ 예제 코드 (VB)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
Public Type SYSTEMTIME Year As Integer Month As Integer DayOfWeek As Integer Day As Integer Hour As Integer Minute As Integer Second As Integer Millisecond As Integer End Type Public Declare Sub GetLocalTime Lib "kernel32" (pSYSTEMTIME As SYSTEMTIME) Private Sub cmdTest_Click() Dim pSYSTEMTIME As SYSTEMTIME GetLocalTime pSYSTEMTIME MsgBox pSYSTEMTIME.Hour & ":" & pSYSTEMTIME.Minute & ":" & pSYSTEMTIME.Second & "." & pSYSTEMTIME.Millisecond End Sub |