以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]有方法知道两个时间之间的毫秒吗 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=37237) |
-- 作者:ifastudy -- 发布时间:2013/7/3 11:47:00 -- [求助]有方法知道两个时间之间的毫秒吗 我看了timespan,但没有办法将当前时间的毫秒记录下来。Now好像只到秒 |
-- 作者:狐狸爸爸 -- 发布时间:2013/7/3 11:56:00 -- 算出秒数差,就知道毫秒数差了啊,乘以1000即可啊 |
-- 作者:ifastudy -- 发布时间:2013/7/3 12:01:00 -- 那最小单位是秒还是毫秒呢?我想测试系统性能 |
-- 作者:Bin -- 发布时间:2013/7/3 12:01:00 -- MessageBox.show(DateTime.Now.Millisecond) |
-- 作者:Bin -- 发布时间:2013/7/3 12:10:00 -- 测试一段程序运行消耗的时间 其实有个很好用的类. Dim sp As new System.Diagnostics.Stopwatch() sp.start() Dim i1 = 0 For i As Integer= 0 To 10000000 i1=i Next sp.stop() MessageBox.show(sp.ElapsedMilliseconds) \'获得这段程序运行消耗的毫秒. |
-- 作者:ifastudy -- 发布时间:2013/7/3 12:24:00 -- 太好,谢谢bin老大。 |