Skip to content

silentsoft/stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stopwatch

Maven Central Build Status Quality Gate Status Coverage Hits

Stopwatch for get rid of chore in your code.

Usage

Stopwatch stopwatch = new Stopwatch();

stopwatch.start("initialization");
// ...
stopwatch.stop();

stopwatch.start("processing");
// ...
stopwatch.stop();

stopwatch.start("rendering");
// ...
stopwatch.stop();

stopwatch.print();

Result

|           name |     % |      ms |      s |
|----------------|-------|---------|--------|
| initialization | 59.5% | 1,234ms | 1.234s |
|     processing | 40.0% |   830ms | 0.830s |
|      rendering |  0.5% |    10ms | 0.010s |
|                |       |         |        |
|          total |  100% | 2,074ms | 2.074s |

Maven Central

<dependency>
    <groupId>org.silentsoft</groupId>
    <artifactId>stopwatch</artifactId>
    <version>2.2.1</version>
</dependency>

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please note we have a CODE_OF_CONDUCT, please follow it in all your interactions with the project.

License

Please refer to LICENSE.