Timer 函数-宏鹏
Access软件网QQ交流学习群(群号码198465573),欢迎您的加入!
首页 >技术文章> Access数据库-模块/函数/VBA


Timer 函数

发表时间:2020/4/15 8:51:50 评论(0) 浏览(4110)  评论 | 加入收藏 | 复制
   
摘 要:Timer 函数返回表示自午夜以来已过的秒数的 Single 
正 文:
Timer 函数

返回表示自午夜以来已过的秒数的 Single 。


语法:

Timer


备注:

在 Windows 中, Timer函数返回秒的小数部分。In Windows, the Timer function returns fractional portions of a second. 在 Macintosh 中,定时器分辨率为 1 秒。

示例:

此示例使用 Timer 函数来暂停应用程序。This example uses the Timer function to pause the application. 该示例还使用**DoEvents** 在暂停过程中向其他进程生成。

Dim PauseTime, Start, Finish, TotalTime
If (MsgBox("Press Yes to pause for 5 seconds", 4)) = vbYes Then
    PauseTime = 5    ' Set duration.
    Start = Timer    ' Set start time.
    Do While Timer < Start + PauseTime
        DoEvents    ' Yield to other processes.
    Loop
    Finish = Timer    ' Set end time.
    TotalTime = Finish - Start    ' Calculate total time.
    MsgBox "Paused for " & TotalTime & " seconds"
Else
    End
End If





Access软件网交流QQ群(群号:198465573)
 
 相关文章
为access添加多个Timer功能  【andymark  2008/3/19】
如何利用API实现代码延时执行  【钱玉炜  2008/4/14】
vb中实现延时(等待)的几种方法  【钱玉炜  2008/4/14】
延时秒数,设置延时时间的示例  【叶海峰  2012/8/3】
【Access源码示例】延时函数  【缪炜  2018/12/7】
常见问答
技术分类
相关资源
文章搜索
关于作者

宏鹏

文章分类

文章存档

友情链接