-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime.pde
57 lines (50 loc) · 955 Bytes
/
time.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
int prevMin = -1;
int prevSec = -1;
int totalSec = 0;
int lastMin = -1;
int lastSec = -1;
boolean glont = false;
boolean numSec()
{
int min = minute();
int sec = second();
if(prevMin == -1)
{
prevMin = min;
prevSec = sec;
//println("nu: 0");
return false;
}
totalSec = (min - prevMin) * 60 + sec - prevSec;
glont = totalSec > 3;
if(totalSec > 7)
{
prevMin = min;
prevSec = sec;
// println("da");
return true;
}
//println("nu: " + totalSec);
return false;
}
int time()
{
int min = minute();
int sec = second();
if(lastMin == -1)
{
lastMin = min;
lastSec = sec;
return 0;
}
int total = (min - lastMin) * 60 + sec - lastSec;
return total;
}
int time2(int lm, int ls)
{
int min = minute();
int sec = second();
int total = (min - lm) * 60 + sec - ls;
// println("timp: " + total);
return total;
}