VB.Net:组合秒表值
我目前有两个秒表(在 VB 2010 程序中运行。我想做的是将它们的值组合在一起,并将它们的结果以格式为 0:00:00 的字符串输出。
我尝试了 Add 方法和 + 方法,但是 ,这失败
简而言之
Dim timer1 As New Stopwatch
Dim timer2 As New Stopwatch
[Assuming the timers were started separately]
Dim elapsed1 As TimeSpan = timer1.Elapsed
Dim elapsed2 As TimeSpan = timer2.Elapsed
elapsed1 += elapsed2
了:有人能帮忙吗?
I currently have two stopwatches ( running in a VB 2010 program. What I would like to do is combine their values together and have their results outputted in a string formatted as 0:00:00.
I tried the Add method and the + method but this fails.
This is in short what I have:
Dim timer1 As New Stopwatch
Dim timer2 As New Stopwatch
[Assuming the timers were started separately]
Dim elapsed1 As TimeSpan = timer1.Elapsed
Dim elapsed2 As TimeSpan = timer2.Elapsed
elapsed1 += elapsed2
Can anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加此内容:
或阅读 MSDN TimeSpan.Add Method
add this:
or read from MSDN TimeSpan.Add Method