|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
set up timer start 15 sec past minuteHi, All,
My question is how to set up timer start 15 sec past minute. It always start 15 sec past minute. For example, if current time is 8:30:45, the timer starts on 8:31:15 am; if current time is 8:00:00, the timer starts on 8:00:15; if current time is 8:55:15, the timer starts on 8:55:15, if current time is 8:59:00, the timer starts on 8:59:15 ..., so the timer always starts 15 seconds past minute, can anyone help this out? Thanks in advance Hello martin1,
why not just have yer timer fire every half second and the first thing you check is the current time. -Boo Show quoteHide quote > Hi, All, > > My question is how to set up timer start 15 sec past minute. It always > start 15 sec past minute. For example, if current time is 8:30:45, the > timer starts on 8:31:15 am; if current time is 8:00:00, the timer > starts on 8:00:15; if current time is 8:55:15, the timer starts on > 8:55:15, if current time is 8:59:00, the timer starts on 8:59:15 ..., > so the timer always starts 15 seconds past minute, can anyone help > this out? > > Thanks in advance > Martin,
What timer are you using? There are at least three in System.Net Cor Show quoteHide quote "martin1" <mart***@discussions.microsoft.com> schreef in bericht news:C94FA0DA-50B8-430B-AA3B-A7322ED66E9C@microsoft.com... > Hi, All, > > My question is how to set up timer start 15 sec past minute. It always > start > 15 > sec past minute. For example, if current time is 8:30:45, the timer starts > on > 8:31:15 am; if current time is 8:00:00, the timer starts on 8:00:15; if > current time is 8:55:15, the timer starts on 8:55:15, if current time is > 8:59:00, the timer starts on 8:59:15 ..., so the timer always starts 15 > seconds past minute, can anyone help this out? > > Thanks in advance > > Hi, Cor,
I use form timer (System.Windows.Forms.Timer), any more advice? Thanks Show quoteHide quote "Cor Ligthert [MVP]" wrote: > Martin, > > What timer are you using? > > There are at least three in System.Net > > Cor > > "martin1" <mart***@discussions.microsoft.com> schreef in bericht > news:C94FA0DA-50B8-430B-AA3B-A7322ED66E9C@microsoft.com... > > Hi, All, > > > > My question is how to set up timer start 15 sec past minute. It always > > start > > 15 > > sec past minute. For example, if current time is 8:30:45, the timer starts > > on > > 8:31:15 am; if current time is 8:00:00, the timer starts on 8:00:15; if > > current time is 8:55:15, the timer starts on 8:55:15, if current time is > > 8:59:00, the timer starts on 8:59:15 ..., so the timer always starts 15 > > seconds past minute, can anyone help this out? > > > > Thanks in advance > > > > > > > Martin,
Than you can in my idea set the milliseconds after that you have extracted the seconds (not the milliseconds) for that from the datetime. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformstimerclassintervaltopic.asp http://msdn2.microsoft.com/en-us/library/system.datetime.second.aspx Your maximum is in my idea 60 *1000. I hope this helps, Cor Show quoteHide quote "martin1" <mart***@discussions.microsoft.com> schreef in bericht news:8913EAB2-F7A6-4136-8D9E-870F042A7967@microsoft.com... > Hi, Cor, > > I use form timer (System.Windows.Forms.Timer), any more advice? > > Thanks > > "Cor Ligthert [MVP]" wrote: > >> Martin, >> >> What timer are you using? >> >> There are at least three in System.Net >> >> Cor >> >> "martin1" <mart***@discussions.microsoft.com> schreef in bericht >> news:C94FA0DA-50B8-430B-AA3B-A7322ED66E9C@microsoft.com... >> > Hi, All, >> > >> > My question is how to set up timer start 15 sec past minute. It always >> > start >> > 15 >> > sec past minute. For example, if current time is 8:30:45, the timer >> > starts >> > on >> > 8:31:15 am; if current time is 8:00:00, the timer starts on 8:00:15; if >> > current time is 8:55:15, the timer starts on 8:55:15, if current time >> > is >> > 8:59:00, the timer starts on 8:59:15 ..., so the timer always starts >> > 15 >> > seconds past minute, can anyone help this out? >> > >> > Thanks in advance >> > >> > >> >> >> Thank you. Cor,
So the logic is retrive current second, if = 15 sec, then start timer The code look likes: Dim moment As New System.DateTime Private Shared myTimer As New System.Windows.Forms.Timer() Dim second As Integer = moment.Second if second = 20 then myTimer.Interval = 60000 myTimer.Start() end if Is this correct? Thanks, Show quoteHide quote "Cor Ligthert [MVP]" wrote: > Martin, > > Than you can in my idea set the milliseconds after that you have extracted > the seconds (not the milliseconds) for that from the datetime. > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformstimerclassintervaltopic.asp > > http://msdn2.microsoft.com/en-us/library/system.datetime.second.aspx > > Your maximum is in my idea 60 *1000. > > I hope this helps, > > Cor > > > > > "martin1" <mart***@discussions.microsoft.com> schreef in bericht > news:8913EAB2-F7A6-4136-8D9E-870F042A7967@microsoft.com... > > Hi, Cor, > > > > I use form timer (System.Windows.Forms.Timer), any more advice? > > > > Thanks > > > > "Cor Ligthert [MVP]" wrote: > > > >> Martin, > >> > >> What timer are you using? > >> > >> There are at least three in System.Net > >> > >> Cor > >> > >> "martin1" <mart***@discussions.microsoft.com> schreef in bericht > >> news:C94FA0DA-50B8-430B-AA3B-A7322ED66E9C@microsoft.com... > >> > Hi, All, > >> > > >> > My question is how to set up timer start 15 sec past minute. It always > >> > start > >> > 15 > >> > sec past minute. For example, if current time is 8:30:45, the timer > >> > starts > >> > on > >> > 8:31:15 am; if current time is 8:00:00, the timer starts on 8:00:15; if > >> > current time is 8:55:15, the timer starts on 8:55:15, if current time > >> > is > >> > 8:59:00, the timer starts on 8:59:15 ..., so the timer always starts > >> > 15 > >> > seconds past minute, can anyone help this out? > >> > > >> > Thanks in advance > >> > > >> > > >> > >> > >> > > > Martin,
No of course not. Something as > Dim moment As New System.DateTime if second < 16 then> Private Shared myTimer As New System.Windows.Forms.Timer() > > Dim second As Integer = moment.Second > myTimer.Interval = Cint(14 * 1000) else myTimer.Interval = CInt(second * 1000) end if myTimer.Start() I did not check this, but something as this, Cor Hi, Cor,
the timer interval = 60 sec (60000milSec), I want timer starts 15 sec past minute no matter when start the application, the app has the timer to refresh data. so how to change the code? Thanks Show quoteHide quote "Cor Ligthert [MVP]" wrote: > Martin, > > No of course not. Something as > > > > Dim moment As New System.DateTime > > Private Shared myTimer As New System.Windows.Forms.Timer() > > > > Dim second As Integer = moment.Second > > > if second < 16 then > myTimer.Interval = Cint(14 * 1000) > else > myTimer.Interval = CInt(second * 1000) > end if > myTimer.Start() > > I did not check this, but something as this, > > Cor > > > To get 15 seconds after midnight, use the following
Dim ts As TimeSpan = Now.Date.AddDays(1).AddSeconds(15) - Now All the timer controls in dotNet can set their interval using a timespan object. Mike Ober. Show quoteHide quote "martin1" <mart***@discussions.microsoft.com> wrote in message news:8913EAB2-F7A6-4136-8D9E-870F042A7967@microsoft.com... > Hi, Cor, > > I use form timer (System.Windows.Forms.Timer), any more advice? > > Thanks > > "Cor Ligthert [MVP]" wrote: > > > Martin, > > > > What timer are you using? > > > > There are at least three in System.Net > > > > Cor > > > > "martin1" <mart***@discussions.microsoft.com> schreef in bericht > > news:C94FA0DA-50B8-430B-AA3B-A7322ED66E9C@microsoft.com... > > > Hi, All, > > > > > > My question is how to set up timer start 15 sec past minute. It always > > > start > > > 15 > > > sec past minute. For example, if current time is 8:30:45, the timer starts > > > on > > > 8:31:15 am; if current time is 8:00:00, the timer starts on 8:00:15; if > > > current time is 8:55:15, the timer starts on 8:55:15, if current time is > > > 8:59:00, the timer starts on 8:59:15 ..., so the timer always starts 15 > > > seconds past minute, can anyone help this out? > > > > > > Thanks in advance > > > > > > > > > > > > HI, Mike,
how to set 15 sec past minute no matter when the app starts, Thanks Show quoteHide quote "Michael D. Ober" wrote: > To get 15 seconds after midnight, use the following > > Dim ts As TimeSpan = Now.Date.AddDays(1).AddSeconds(15) - Now > > All the timer controls in dotNet can set their interval using a timespan > object. > > Mike Ober. > > > "martin1" <mart***@discussions.microsoft.com> wrote in message > news:8913EAB2-F7A6-4136-8D9E-870F042A7967@microsoft.com... > > Hi, Cor, > > > > I use form timer (System.Windows.Forms.Timer), any more advice? > > > > Thanks > > > > "Cor Ligthert [MVP]" wrote: > > > > > Martin, > > > > > > What timer are you using? > > > > > > There are at least three in System.Net > > > > > > Cor > > > > > > "martin1" <mart***@discussions.microsoft.com> schreef in bericht > > > news:C94FA0DA-50B8-430B-AA3B-A7322ED66E9C@microsoft.com... > > > > Hi, All, > > > > > > > > My question is how to set up timer start 15 sec past minute. It always > > > > start > > > > 15 > > > > sec past minute. For example, if current time is 8:30:45, the timer > starts > > > > on > > > > 8:31:15 am; if current time is 8:00:00, the timer starts on 8:00:15; > if > > > > current time is 8:55:15, the timer starts on 8:55:15, if current time > is > > > > 8:59:00, the timer starts on 8:59:15 ..., so the timer always starts > 15 > > > > seconds past minute, can anyone help this out? > > > > > > > > Thanks in advance > > > > > > > > > > > > > > > > > > > > >
GetFiles exception
Threading... Copy / Paste, Excel To flexgrid On error resume next bug Encrypt My.Settings setting? lastLogonTimestamp group enumerators so intellisense shows them in VB6? Public Structure An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll Sendmessage problem help! |
|||||||||||||||||||||||