WEBVTT 00:00:06.810 --> 00:00:09.020 Nounless move to the time seconds. 00:00:09.240 --> 00:00:09.830 OK. 00:00:09.900 --> 00:00:20.430 So inside one second we've got one hundred sixty seconds so we're going to do exactly the same thing 00:00:20.450 --> 00:00:20.490 . 00:00:20.520 --> 00:00:37.720 So time seconds is going to be Marth floor of the division by 100. 00:00:38.560 --> 00:00:38.870 OK. 00:00:38.930 --> 00:00:45.350 But this time we are going to divide the remainder of our first division. 00:00:45.500 --> 00:00:46.620 OK. 00:00:46.800 --> 00:00:48.990 And the remainder of the First Division 00:00:53.700 --> 00:00:57.000 is this. 00:00:57.000 --> 00:01:03.120 So this means the remainder of dividing time counter by 6000. 00:01:03.920 --> 00:01:09.870 OK. 00:01:10.560 --> 00:01:16.600 And finally the center seconds are going to be the remainder of this division. 00:01:16.830 --> 00:01:27.000 OK so time 10 seconds is going to be the remainder of that division 00:01:32.100 --> 00:01:36.700 which is this guy. 00:01:36.750 --> 00:01:40.550 And we don't need the math floor method for this. 00:01:41.030 --> 00:01:42.090 OK. 00:01:43.140 --> 00:01:51.600 So let's do the same thing for the loop variables. 00:01:52.410 --> 00:01:57.940 So we're going to change the time we need to a lot of minutes. 00:01:58.650 --> 00:02:01.110 And the same thing for the other two variables 00:02:10.120 --> 00:02:19.270 . 00:02:19.530 --> 00:02:20.070 OK. 00:02:20.130 --> 00:02:22.770 Now we will need to access these elements. 00:02:22.980 --> 00:02:23.480 OK. 00:02:23.700 --> 00:02:30.220 Using their IDs anti-New their values to these valid variables values. 00:02:30.240 --> 00:02:30.870 OK. 00:02:31.050 --> 00:02:31.350 So 00:02:37.170 --> 00:02:43.860 we're going to be using their IDs which I was following so we called the lock me in its last second 00:02:44.140 --> 00:02:46.870 lubs and second and the same thing for the times. 00:02:46.950 --> 00:02:47.460 OK. 00:02:47.580 --> 00:02:47.940 So 00:02:53.150 --> 00:03:00.590 so is access the time elements first starting with the minutes so we can access each element using its 00:03:00.600 --> 00:03:02.640 ID. 00:03:02.640 --> 00:03:12.000 So we starting with the time in its element and we are assessing its text using the text method to the 00:03:12.690 --> 00:03:24.150 variable Claymates of variables value 20 minutes OK and then you to do the same thing for the seconds 00:03:24.570 --> 00:03:26.570 and the send seconds. 00:03:27.150 --> 00:03:29.060 So we're looking here it's time. 00:03:29.310 --> 00:03:29.790 Second 00:03:33.040 --> 00:03:39.600 guessing to time seconds and then time senti second 00:03:45.420 --> 00:03:48.600 as we are setting to time since seconds 00:03:51.540 --> 00:03:52.670 and then go do the same. 00:03:52.740 --> 00:03:54.170 Same thing for the Lap's 00:03:54.190 --> 00:03:59.870 . 00:04:06.870 --> 00:04:08.400 So you access the minutes 00:04:13.080 --> 00:04:17.590 they just copy this code to make it easier for us. 00:04:18.690 --> 00:04:22.080 So we are looking at not minutes 00:04:26.280 --> 00:04:36.660 per second and the second and the variables are locked minutes 00:04:39.780 --> 00:04:45.070 seconds and lubs in seconds. 00:04:45.740 --> 00:04:52.430 OK let's say this and let's click on the start. 00:04:53.580 --> 00:04:55.180 OK so we can see that it's working. 00:04:55.500 --> 00:04:56.480 OK. 00:04:56.520 --> 00:05:03.030 Now of course one issue we don't like to see single numbers or single days like this. 00:05:03.390 --> 00:05:08.410 So our file up shows that we've got all the time two digits. 00:05:08.770 --> 00:05:09.500 OK. 00:05:09.840 --> 00:05:17.970 So to do this we are going to create a function to formats our numbers 00:05:26.030 --> 00:05:31.770 and we're going to call it four months just like this. 00:05:31.770 --> 00:05:32.250 OK. 00:05:32.260 --> 00:05:41.790 So he's going to take one time into a number and is going to check if the number is less than 10. 00:05:42.360 --> 00:05:56.020 So if the number is less than 10 then it's going to return a string which is going to be zero. 00:05:56.250 --> 00:05:58.030 Plus our number. 00:05:59.290 --> 00:06:00.210 OK. 00:06:00.300 --> 00:06:08.440 Otherwise it's just going to return the number itself. 00:06:11.920 --> 00:06:13.240 OK. 00:06:13.260 --> 00:06:20.610 So before using these variables we're going to use the Format function 00:06:24.230 --> 00:06:25.250 just like this. 00:06:25.500 --> 00:06:25.740 OK 00:06:25.750 --> 00:06:42.180 . 00:06:51.070 --> 00:06:51.500 OK. 00:06:51.600 --> 00:06:54.830 Let's save and check again. 00:06:55.160 --> 00:06:58.890 And now it's perfect. 00:06:59.450 --> 00:07:04.630 We need to wait until 1 minute to make sure that the minutes are working as well. 00:07:04.680 --> 00:07:07.570 So was going to post the video and wait and see how he's there. 00:07:08.280 --> 00:07:10.470 OK we are almost there. 00:07:10.470 --> 00:07:16.260 So let's see how it's working. 00:07:17.600 --> 00:07:17.890 OK. 00:07:17.940 --> 00:07:25.390 So we haven't implemented any code yet for the soapers And so our code so far is working. 00:07:26.580 --> 00:07:28.370 Now let's take something. 00:07:28.620 --> 00:07:34.060 If the counting keeps going the number of minutes is going to become too big. 00:07:34.650 --> 00:07:42.340 And if we want to limit stats we can do that by going back to our set interval function. 00:07:42.390 --> 00:07:50.840 So every time we increase the counter by one we can check the counter against our limits. 00:07:50.880 --> 00:07:55.340 So let's say we want to limit the number of minutes at 100. 00:07:55.720 --> 00:08:01.530 OK so now we aren't going to check if the counter 00:08:04.960 --> 00:08:11.100 pay is equal to that to the number of sunny seconds corresponding to 100 minutes which is 100. 00:08:11.240 --> 00:08:16.010 Multiply it by 60 seconds multiplied by one hundred ten seconds. 00:08:16.250 --> 00:08:23.710 OK then we are going to reset our counter to zero. 00:08:24.900 --> 00:08:25.640 OK. 00:08:25.840 --> 00:08:28.950 And I do the same thing for the last count 00:08:35.680 --> 00:08:38.770 we are ticking if it's also only two equal signs. 00:08:38.860 --> 00:08:41.970 OK so same thing there. 00:08:42.640 --> 00:08:44.780 Well the lunch counter. 00:08:45.890 --> 00:08:48.840 OK here we go. 00:08:48.870 --> 00:08:51.480 All right. 00:08:51.480 --> 00:08:55.990 Now let's move to the code corresponding to clicking on the stop button. 00:08:56.280 --> 00:08:57.030 OK. 00:08:57.340 --> 00:08:59.040 And we're going to continue in the next video 00:08:59.050 --> 00:09:06.730 .