-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
measuring time, counting attributes, numerous fixes
- Loading branch information
Luca Liechti
committed
Jan 31, 2017
1 parent
e4bf946
commit 6f7d585
Showing
6 changed files
with
92 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
/driver/ | ||
/parsers/ | ||
/tests/ | ||
/timer/ | ||
/tools/ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package tools; | ||
import java.util.Date; | ||
|
||
/** | ||
* A utility class to help us run benchmarks. | ||
* | ||
* @author [email protected] | ||
* @version 1.0 1998-11-25 | ||
*/ | ||
public class Timer { | ||
long _startTime; | ||
|
||
/** | ||
* You can either create a new instance whenever | ||
* you want to time something, or you can reset() | ||
* an existing instance. | ||
*/ | ||
public Timer() { this.reset(); } | ||
|
||
public void reset() { | ||
_startTime = this.timeNow(); | ||
} | ||
|
||
/** | ||
* How many milliseconds have elapsed since | ||
* the last reset()? NB: does not reset the timer! | ||
*/ | ||
public long timeElapsed() { | ||
return this.timeNow() - _startTime; | ||
} | ||
|
||
protected long timeNow() { | ||
return new Date().getTime(); | ||
} | ||
} |