VBA - 显示时钟精度不到一秒钟 [英] VBA - show clock time with accuracy of less than a second

查看:142
本文介绍了VBA - 显示时钟精度不到一秒钟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法使用VBA(excel)来生成精确到十分之一秒的时钟时间?

Is there a way to use VBA (excel) to generate a clock time with accuracy to a tenth of a second or less?

例如:

Sub test()
    MsgBox Format(Time, "hh:mm:ss???") 'not sure what this format should be...
End Sub


推荐答案

我认为时间不会给出这些信息。

I think that Time doesn't give that information.

您可以使用计时器进行额外的准确性。

You can use Timer for extra accuracy.


在Microsoft Windows中,定时器
函数返回小数部分
一秒钟。在Macintosh上,定时器
的分辨率是一秒钟。

In Microsoft Windows the Timer function returns fractional portions of a second. On the Macintosh, timer resolution is one second.

这是一个例子:

MsgBox Format(Time, "hh:mm:ss:" & Right(Format(Timer, "#0.00"), 2))

这篇关于VBA - 显示时钟精度不到一秒钟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆