An open API service indexing awesome lists of open source software.

https://github.com/artus/aevum

⏱️ Time the execution of your code
https://github.com/artus/aevum

code-metrics java java-8 maven metrics stopwatch

Last synced: 11 months ago
JSON representation

⏱️ Time the execution of your code

Awesome Lists containing this project

README

          

# Aevum
## Time code execution

[![Build Status](https://travis-ci.org/artus/aevum.svg?branch=master)](https://travis-ci.org/artus/aevum)

## Example

```java
ProcessTimer myTimer = new ProcessTimer();
myTimer
.onStart(timer -> System.out.println("Started counting to 10"))
.onStop(timer -> System.out.println("Stopped counting to 10"))
.time(() -> {
int count = 0;
while (count < 10) System.out.println(++count);
});

System.out.println(String.format("Counting to 10 took %d milliseconds.", myTimer.getDuration().toMillis()));
```