You could use this logic. . . .

Regards - OHM#

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As

System.EventArgs) Handles Button1.Click

Dim minute As Int32

Dim interval As Int32

For minute = 0 To 60

Select Case minute

Case 0 To 4

interval = 5 - minute

Case 6 To 14

interval = 15 - minute

Case 16 To 24

interval = 25 - minute

Case 26 To 34

interval = 35 - minute

Case 36 To 44

interval = 45 - minute

Case 46 To 54

interval = 55 - minute

Case 56 To 60

interval = 5 + (60 - minute)

Case 5, 15, 25, 35, 45, 55

interval = 10

End Select

Debug.WriteLine("Minute: " & minute & " - Interval = " & interval)

Next

End Sub

Prints This Out . . .

Minute: 0 - Interval = 5

Minute: 1 - Interval = 4

Minute: 2 - Interval = 3

Minute: 3 - Interval = 2

Minute: 4 - Interval = 1

Minute: 5 - Interval = 10

Minute: 6 - Interval = 9

Minute: 7 - Interval = 8

Minute: 8 - Interval = 7

Minute: 9 - Interval = 6

Minute: 10 - Interval = 5

Minute: 11 - Interval = 4

Minute: 12 - Interval = 3

Minute: 13 - Interval = 2

Minute: 14 - Interval = 1

Minute: 15 - Interval = 10

Minute: 16 - Interval = 9

Minute: 17 - Interval = 8

Minute: 18 - Interval = 7

Minute: 19 - Interval = 6

Minute: 20 - Interval = 5

Minute: 21 - Interval = 4

Minute: 22 - Interval = 3

Minute: 23 - Interval = 2

Minute: 24 - Interval = 1

Minute: 25 - Interval = 10

Minute: 26 - Interval = 9

Minute: 27 - Interval = 8

Minute: 28 - Interval = 7

Minute: 29 - Interval = 6

Minute: 30 - Interval = 5

Minute: 31 - Interval = 4

Minute: 32 - Interval = 3

Minute: 33 - Interval = 2

Minute: 34 - Interval = 1

Minute: 35 - Interval = 10

Minute: 36 - Interval = 9

Minute: 37 - Interval = 8

Minute: 38 - Interval = 7

Minute: 39 - Interval = 6

Minute: 40 - Interval = 5

Minute: 41 - Interval = 4

Minute: 42 - Interval = 3

Minute: 43 - Interval = 2

Minute: 44 - Interval = 1

Minute: 45 - Interval = 10

Minute: 46 - Interval = 9

Minute: 47 - Interval = 8

Minute: 48 - Interval = 7

Minute: 49 - Interval = 6

Minute: 50 - Interval = 5

Minute: 51 - Interval = 4

Minute: 52 - Interval = 3

Minute: 53 - Interval = 2

Minute: 54 - Interval = 1

Minute: 55 - Interval = 10

Minute: 56 - Interval = 9

Minute: 57 - Interval = 8

Minute: 58 - Interval = 7

Minute: 59 - Interval = 6

Minute: 60 - Interval = 5

Crirus wrote:

Well, I dont think I need two timers...

If I can start the timer in order to raise tick event exact as if it

was started at base start time (minute 15) the problem is solved

without any boolean or second timer

All I need is to figure out how many minutes I still need to wait

until first tick

So if I enable the timer at minute 33 of curent hour, I need to set

the interval to 2 minutes in order to haev first tick at minute 35

If I enable the timer on minute 10, I have to wait 5 minute untill

first ticck should occur, on minute 15..and so one

All I need is that interval that is first wait, considering hte

interval and base tick minute (e.g. 15)

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in

message news:ub****************@TK2MSFTNGP09.phx.gbl... This was untested PSEUDO Code. The intention is clear even if the

syntax is not correct. When I write 'Actual' code, you can come back

and criticise me OK

Replace this with . . As PSEUDO

While MinuteNow < 15

MinuteNow = Now.GetMinute

Loop

OHM#

EricJ wrote: 2 remarks if i may ;p

1 i think timenow never gets a new value so the loop will never end

(update it in the while loop)

2 it looks like the while loop will run non stop, in the while loop

call doevents or a sleep

i don't think users would be happy when they click the button at

13:01 and have to wait 14mins to do anithing w their pc

alternative could be working w 2 timers start the first one when the

user clicks set it for 1min intervals and when the MinuteNow < 15 is

reached launch the second one w 10min itervals and stop the first

one.

hope it helps

"One Handed Man [ OHM# ]" <On**********@BTInternet.com> wrote in

message news:OF**************@TK2MSFTNGP12.phx.gbl...

PSEUDO - Hope this helps - Regards OHM#

Dim FirstTick As Boolean = True

Dim TimeNow as New DateTime = Now

Dim MinuteNow As Int32 = TimeNow.GetMinute

Dim InterimInterval As Int32

While MinuteNow < 15

MinuteNow = TimeNow.GetMinute

Loop

InterimInterval = 10 - ( MinuteNow MOD 10 )

Set Timer = InterimInterval

Sub On TimerTick

If FirstTick The

Set Timer Interval = 10

FirstTick = False

End If

End Sub

Crirus wrote:

> This is more a logical problem than a VB.

>

> I have this situation:

>

> A timer that need to tick at each 10 minutes starting on minute 15

> of curent hour.

>

> But I want to calculate the next tick time whenever I want to

> start the timer.

>

> So, I have ticks on minutes 25, 35, 45, 55, 05

>

> If I start the timer on minute 33 I need that 2 minutes interval

> untill 35 in order to start the timer..

> On tick event I reset the interval to 10 minutes.

> How to calculate that 2 minute interval?

Regards - OHM# On**********@BTInternet.com

Regards - OHM# On**********@BTInternet.com

Regards - OHM#

On**********@BTInternet.com