1
00:00:00,650 --> 00:00:01,680
Hello, welcome back.

2
00:00:01,700 --> 00:00:06,320
In this lesson, we shall see how to stop our auto reload the timer.

3
00:00:07,220 --> 00:00:15,070
In a previous lesson, we saw how to create the auto reload on the one short timer and we saw the difference.

4
00:00:15,080 --> 00:00:16,970
I'm going to make a copy of the last project.

5
00:00:17,000 --> 00:00:18,230
Should I explain from there?

6
00:00:18,260 --> 00:00:21,650
We have twenty three over here working with time as software time.

7
00:00:21,830 --> 00:00:26,390
It says, I'm going to copy and paste over here and rename this.

8
00:00:31,820 --> 00:00:35,830
Stopping the timer or just call it stopping the timer, okay?

9
00:00:38,350 --> 00:00:39,400
Right, here we are.

10
00:00:41,420 --> 00:00:41,990
This is.

11
00:00:43,410 --> 00:00:44,960
We may not see fall over here.

12
00:00:47,390 --> 00:00:54,790
And we created two time as a one stop time and an auto reload time at the one stop timer.

13
00:00:56,430 --> 00:01:03,180
Or the one short timer we said issued should OK was issued OK after four thousand milliseconds and we

14
00:01:03,180 --> 00:01:06,750
said the auto reload time should OK every five hundred milliseconds.

15
00:01:07,000 --> 00:01:09,960
So the question is it's going to OK every five hundred milliseconds.

16
00:01:09,960 --> 00:01:12,030
How are we going to stop it if we want to stop it?

17
00:01:12,390 --> 00:01:19,230
Well what we could do is we could just put a counter variable in the in the callback function of the

18
00:01:19,230 --> 00:01:24,900
auto reload timer such that when the count variable reaches a particular number, we can stop the timer.

19
00:01:25,290 --> 00:01:26,670
So I can come over here.

20
00:01:27,440 --> 00:01:31,100
And then I can see you ain't.

21
00:01:33,100 --> 00:01:36,910
I can create a variable you in 30 to 40 and then see.

22
00:01:38,370 --> 00:01:44,790
Time outs can't remember the callback function is going to occur every five hundred milliseconds at

23
00:01:44,790 --> 00:01:48,660
time out of every five hundred hours, so time out, can't hear.

24
00:01:49,970 --> 00:01:51,410
I can initialize this to zero.

25
00:01:52,230 --> 00:01:52,730
OK.

26
00:01:54,200 --> 00:01:57,790
And then come in here and see, OK?

27
00:02:01,540 --> 00:02:09,550
Whenever this happens, I'm going to increment time out and then I could check if the time out Ecorse

28
00:02:09,550 --> 00:02:15,820
10 such that let's see if we've had we want to stop this timer after ten timeout.

29
00:02:17,220 --> 00:02:21,180
So I could see if time out here.

30
00:02:23,180 --> 00:02:27,650
We want to stop it if the timeout is equal to 10, if timeout is is.

31
00:02:30,330 --> 00:02:34,380
Because of was 10, we can simply see I can define a value here.

32
00:02:36,130 --> 00:02:38,110
You inserted to underscore T.

33
00:02:40,230 --> 00:02:41,550
I can make this constant.

34
00:02:50,280 --> 00:02:51,240
I can call this.

35
00:02:54,210 --> 00:02:59,600
Stop, Mark, something like this, and this is OK.

36
00:03:01,490 --> 00:03:02,450
So I can see.

37
00:03:05,520 --> 00:03:08,460
If Time article stop Mark, then.

38
00:03:10,110 --> 00:03:13,830
We can simply call our X time to stop function.

39
00:03:16,540 --> 00:03:18,700
And the next time I stop function.

40
00:03:19,780 --> 00:03:23,860
Just takes the, uh, it looks similar to our next time I start.

41
00:03:24,910 --> 00:03:27,040
So over here, it's time to stop.

42
00:03:28,840 --> 00:03:36,010
It takes one argument, the handle of the timer, so I change this word starts to stop OK, like this,

43
00:03:36,790 --> 00:03:37,270
right.

44
00:03:38,650 --> 00:03:40,000
And then we can print something.

45
00:03:46,020 --> 00:03:47,130
If we could say.

46
00:03:49,530 --> 00:03:50,520
Stop, Mark.

47
00:03:51,670 --> 00:03:52,210
Reached.

48
00:03:59,320 --> 00:04:02,120
Of what the cops look suspicious.

49
00:04:02,960 --> 00:04:11,450
And then we see percentage Delva here, carriage return, new line, and then we can still print the

50
00:04:11,450 --> 00:04:12,080
current value.

51
00:04:14,780 --> 00:04:17,370
So that we know when the stock market reached OK?

52
00:04:19,410 --> 00:04:23,400
Today, and then we stop the timer, let's click over here to build.

53
00:04:25,800 --> 00:04:26,490
Right, click.

54
00:04:27,870 --> 00:04:29,240
Huge project over here.

55
00:04:31,430 --> 00:04:32,090
It's in.

56
00:04:33,600 --> 00:04:37,140
Uh, uh, there's an anomaly, of course.

57
00:04:38,640 --> 00:04:46,080
I wonder why the cops came on OK, stop should be spelled this way over here to build.

58
00:04:50,260 --> 00:04:51,640
There's another anomaly.

59
00:04:51,880 --> 00:04:57,940
OK, so our next time I stop API, OK, we need to indicates the block time as well.

60
00:04:58,090 --> 00:05:00,820
It takes two arguments to block time.

61
00:05:01,540 --> 00:05:03,430
Over here, we pass in a blocked time of zero.

62
00:05:05,740 --> 00:05:08,440
OK, let's build a click over here to build.

63
00:05:10,460 --> 00:05:11,690
It's built successfully.

64
00:05:12,800 --> 00:05:16,130
All right, click over here and then.

65
00:05:17,520 --> 00:05:22,170
S. Debuggers Ystem 32, select twenty four Aubagio.

66
00:05:24,210 --> 00:05:26,370
And I'll see, OK, over here.

67
00:05:30,540 --> 00:05:31,950
It's opening the debark for you.

68
00:05:33,850 --> 00:05:34,960
Click switch over here.

69
00:05:36,550 --> 00:05:38,260
And I'm going to make space.

70
00:05:47,240 --> 00:05:47,960
Click here.

71
00:05:49,460 --> 00:05:51,980
Me, this I'm going to open real to.

72
00:05:54,720 --> 00:05:57,090
I'm going to select new line mode over here.

73
00:05:57,540 --> 00:05:58,620
So like a portrait.

74
00:05:59,550 --> 00:06:03,150
This one here, then, how old is this?

75
00:06:03,810 --> 00:06:06,300
And I'm going to click to Open and then I'll click to run.

76
00:06:07,130 --> 00:06:09,290
OK, so time is running.

77
00:06:12,670 --> 00:06:15,850
OK, so you see, stop, Mark reached at five thousand.

78
00:06:15,970 --> 00:06:23,710
Of course, we said after ten executions of the callback function, we should stop and if 500 EMS,

79
00:06:23,710 --> 00:06:27,190
OK is ten times, we end up with five thousand.

80
00:06:27,380 --> 00:06:33,400
OK, so this is a way that you can stop your timer during runtime.

81
00:06:33,580 --> 00:06:38,360
OK, so this order is for the short lesson and I'll see you the next lesson.

82
00:06:38,380 --> 00:06:39,070
Have a nice day.
