| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 674 人关注过本帖
标题:What do you want to say
取消只看楼主 加入收藏
adair
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:250
专家分:0
注 册:2005-9-3
收藏
 问题点数:0 回复次数:2 
What do you want to say
I write a code as follow to detect the timer event(System.timers.timer).

timer1.interval=100
timer1.AutoReset=Ture
timer1.enable=false

'My test code
Imports vb = Microsoft.VisualBasic 'above all codes
Dim startime As Single
Dim sresult() As Single = New Single(10000) {} 'record each start time
Dim i As Integer
Dim j As Integer

Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
sresult(i) = vb.Timer
i += 1
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Enabled = True
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = False
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
j += 1
TextBox3.Text = sresult(j) - sresult(j - 1)
End Sub

OK! What do u think it will be in textbox3?(After the second click)
Wait for a minute to go on pls.Just say what do you think the answer now.

OK! Come on,Everybody.Have you done it in your project?
What is the result?
And What i can see is:
The number 0.09375 and 0.109375 displays alternatly.

Why isn't it always 0.1 ?
What is the number 0.09375 or 0.109375?

And when i set timer1.interval=10
the alternate number is :"0" and 0.015625

Thank you for all


ICQ:258-235-734
MSN:msnadair@hotmail.com
搜索更多相关主题的帖子: What want say 
2006-05-20 17:10
adair
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:250
专家分:0
注 册:2005-9-3
收藏
得分:0 

你引进SYSTEM.TIMERS.TIMER就OK了.
它是定时触发.不像WINDOWS.FORM.TIMER
每五分钟计一次费就把TIMER的INTERVAL设为5分钟就OK了.
再在TIMER的ELAPSED事件中加入代码就OK了.


********年轻无极限******** 要時刻相信你自己,不要被自己打敗
2006-05-22 08:17
adair
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:250
专家分:0
注 册:2005-9-3
收藏
得分:0 

这么明白了还要代码.
我看你得了实例症.


********年轻无极限******** 要時刻相信你自己,不要被自己打敗
2006-05-22 13:01
快速回复:What do you want to say
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031838 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved