Timer Function

ត្រឡប់​តម្លៃ​ដែល​បញ្ជាក់​ពី​ចំនួន​វិនាទី ដែល​ត្រូវ​បាន​កន្លង​ទៅ​តាំង​ពី​កណ្តាល​អាធ្រាត្រ ។

រូប​តំណាង​ចំណាំ

ដំបូង​អ្នក​ត្រូវ​តែ​ប្រកាស​អថេរ​មួយ​ដើម្បី​ហៅ​អនុគមន៍ Timer និង​ផ្តល់​តម្លៃ​វា​នូវ​ប្រភេទ​ទិន្នន័យ "Long " បើ​ពុំ​នោះ​សោត​តម្លៃ Date ត្រូវ​បាន​ត្រឡប់ ។


Syntax:


  Timer

Return value:

កាល​​បរិច្ឆេទ

Example:


  Sub ExampleTimer
      Dim lSec As Long,lMin As Long,lHour As Long
      lSec = Timer
      MsgBox lSec, 0, "Seconds since midnight"
      lMin = lSec / 60
      lSec = lSec Mod 60
      lHour = lMin / 60
      lMin = lMin Mod 60
    MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2), 0, "The time is"
End Sub
note

The Timer function measures time in seconds. To measure time in milliseconds use the Timer service available in the ScriptForge library.