标题:What do you want to say
只看楼主
adair
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:250
专家分:0
注 册:2005-9-3
 问题点数:0 回复次数:5 
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
bobking
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2006-5-17
得分:0 
哥们英文不错呀 能否多说说国语呀!
thanks for the program
能做个计时收费的玩意给俺瞅瞅吗/?

2006-05-20 18:51
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
Viviwei
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:344
专家分:0
注 册:2006-4-11
得分:0 
顶!~

爱上思考,爱上编程,爱上.net!
2006-05-22 08:53
bobking
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2006-5-17
得分:0 
以下是引用adair在2006-5-22 8:17:00的发言:

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

谢谢 要是能把代码写给俺看看就更好了`


2006-05-22 10:03
adair
Rank: 3Rank: 3
等 级:新手上路
威 望:9
帖 子:250
专家分:0
注 册:2005-9-3
得分:0 

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


********年轻无极限******** 要時刻相信你自己,不要被自己打敗
2006-05-22 13:01



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-65823-1-1.html




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

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