Skip to content

Commit 7dbefcd

Browse files
committed
Create TimeRecord.java
1 parent f00d76e commit 7dbefcd

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

src/main/java/time/TimeRecord.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package time;
2+
3+
public class TimeRecord {
4+
5+
private long start, end;
6+
7+
public void start() {
8+
start = System.currentTimeMillis();
9+
}
10+
11+
public int stop() {
12+
end = System.currentTimeMillis();
13+
return (int) (end - start);
14+
}
15+
16+
public int getTime() {
17+
return (int) (end - start);
18+
}
19+
20+
public int getStart() {
21+
return (int) start;
22+
}
23+
24+
public int getEnd() {
25+
return (int) end;
26+
}
27+
28+
}

0 commit comments

Comments
 (0)