ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[Âà¶K] §óºë½Tªº­p®É VB

[Âà¶K] §óºë½Tªº­p®É VB

¤@¯ë¨Ï¥ÎTimerª«¥ó¡A¨S¦³¿ìªkºë½Tªººâ¨ì·L¬í¡A(¨C¬í¥Ø§ó·s18.2¦¸)¡A­Y­nºâ¨ì
·L¬í¡A«h¨Ï¥ÎGetTickCount ¡A¥¦¶Ç¦^Windows±Ò°Ê«á¨ì¥Ø«e¬°¤î©Ò¸g¹Lªº®É¶¡¡A
¶Ç¦^­È¥H·L¬í¬°³æ¦ì¡C

Private Declare Function GetTickCount Lib "kernel32" Alias _
       "GetTickCount" () As Long

Private CanContinue as Boolean

Private Sub Command1_click()
Dim i as Long
Dim j as Long
i = GetTickCount()
CanContinue = True
Do While CanContinue
   j = GetTickCount()
   if j - i > 50 Then
      Debug.Print "¤w¹L50·L¬í"
      i = j
   End If
   DoEvents
Loop
End Sub

Private Sub Command2_Click()
  CanContinue =  False
End Sub
µ{¦¡¤H­û

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD