定时器随机函数 [英] timer random function
本文介绍了定时器随机函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi ..
我在窗口C#中的计时器中工作,并使用random function()
我希望我的random function()在一个小时内仅调用六次
hi..
i am working in timer in window c# and using random function()
i want my random function() call on only six time in one hours
推荐答案
如果问题中给出的random
函数在<一个小时后,我认为Timer
类的Tick
事件在这里解释了
http://msdn.microsoft.com/en-us/library/system. windows.forms.timer.aspx [ ^ ]
可以通过设置此处说明的Interval
属性来使用
http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.interval.aspx [ ^ ],如下所示
If therandom
function given in the question is to be called 6 times atequal intervals
in an hour then I think theTick
event of theTimer
class explained here
http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx[^]
can be used by setting theInterval
property explained here
http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.interval.aspx[^] as below
myTimer.Interval = 600000;
每10分钟设置间隔\
Hi ,
Set interval every 10 min\
private void Form1_Load(object sender, EventArgs e)
{
timer1.Interval = 600000;
timer1.Start();
}
最好的问候
米特瓦里(M.Mitwalli)
Best Regards
M.Mitwalli
这篇关于定时器随机函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文