Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 2ae6a79

Browse files
📝 Clock Package Documentation
1 parent d2e811a commit 2ae6a79

File tree

1 file changed

+166
-0
lines changed

1 file changed

+166
-0
lines changed

‎src/SomeUtils/Clock/README.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# SomeUtils/Clock
2+
3+
```java
4+
package SomeUtils.Clock;
5+
```
6+
7+
---
8+
9+
## Alarm.java
10+
11+
```java
12+
import SomeUtils.Clock.Alarm;
13+
```
14+
---
15+
16+
### Public Variables
17+
18+
---
19+
20+
```java
21+
public final static int millis;
22+
public final static int seconds;
23+
public final static int nanos;
24+
```
25+
26+
These variables are for setting the unit of time.
27+
28+
---
29+
30+
```java
31+
public interface AlarmWatcher{
32+
public void isRinging(boolean ringing);
33+
}
34+
```
35+
36+
This interface is used to listen for the Alarm.
37+
38+
---
39+
40+
### Public Methods
41+
42+
---
43+
44+
```java
45+
public void start();
46+
```
47+
48+
Used for starting the inner timer.
49+
50+
Not recommended to be called manually; it is automatically called.
51+
52+
---
53+
54+
```java
55+
public void alarmAfter(final long duration, final int unit, final AlarmWatcher watcher);
56+
```
57+
58+
---
59+
60+
## Stopwatch.java
61+
62+
```java
63+
import SomeUtils.Clock.Stopwatch;
64+
```
65+
---
66+
67+
### Public Variables
68+
69+
---
70+
71+
```java
72+
public final static int millis;
73+
public final static int seconds;
74+
public final static int nanos;
75+
```
76+
77+
These variables are for setting the unit of time.
78+
79+
---
80+
81+
### Public Methods
82+
83+
---
84+
85+
```java
86+
public void start();
87+
```
88+
89+
Starts the stopwatch.
90+
91+
---
92+
93+
```java
94+
public long getTimeElapsed();
95+
public long getTimeElapsed(final int unit);
96+
```
97+
98+
Gets the time elapsed after the stopwatch was started.
99+
100+
---
101+
102+
```java
103+
public void lap();
104+
public void split();
105+
```
106+
107+
This records the current lap; splits.
108+
109+
---
110+
111+
```java
112+
public long[][] getLaps();
113+
```
114+
115+
Takes the lap/split method from the object.
116+
117+
---
118+
119+
## Timer.java
120+
121+
```java
122+
import SomeUtils.Clock.Timer;
123+
```
124+
---
125+
126+
### Public Variables
127+
128+
```java
129+
public final static int millis;
130+
public final static int seconds;
131+
public final static int nanos;
132+
```
133+
134+
These variables are for setting the unit of time.
135+
136+
---
137+
138+
```java
139+
public interface TimerWatcher{
140+
public void hasStopped(boolean stopped);
141+
public void timeElapsed(long nano, long millis, long seconds);
142+
public void timeLeft(long timeLeft);
143+
}
144+
```
145+
146+
Used to watch while the timer is running.
147+
148+
---
149+
150+
### Public Methods
151+
152+
```java
153+
public void stopAfter(final long duration, final int unit);
154+
```
155+
156+
Used to pause the thread for a duration.
157+
158+
---
159+
160+
```java
161+
public void setWatcher(final TimerWatcher watcher);
162+
```
163+
164+
Used to latch a watcher before calling the method above.
165+
166+
---

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /