Access开发培训
网站公告
·Access专家课堂QQ群号:151711184    ·Access快速开发平台下载地址及教程    ·欢迎加入Access专家课堂微信群!    ·如何快速搜索本站文章|示例|资料    
您的位置: 首页 > 技术文章 > Access数据库-模块/函数/VBA

Timer 函数

时 间:2020-04-15 08:51:50
作 者:宏鹏   ID:21115  城市:上海
摘 要: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交流群 (群号:483923997)       Access源码网店

常见问答:

技术分类:

相关资源:

专栏作家

关于我们 | 服务条款 | 在线投稿 | 友情链接 | 网站统计 | 网站帮助