Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend the memo feature with optional parameters for expiring entries #1424

Merged
merged 14 commits into from
Jun 12, 2020
7 changes: 6 additions & 1 deletion src/org/rascalmpl/util/SecondsTicker.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
import java.util.concurrent.TimeUnit;

/**
* A monotonic ticker that fast to frequently access and is updated roughly once every second
* A monotonic ticker that fast to frequently access and is updated roughly once every second<br/>
* <br/>
* For more reasons why we want a fast time field, see <a href="http://pzemtsov.github.io/2017/07/23/the-slow-currenttimemillis.html">this discussion</a>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What an incredible thorough and nice blog post! TIL :)

*/
public class SecondsTicker {

Expand Down Expand Up @@ -45,6 +47,9 @@ public class SecondsTicker {
t.start();
}

/**
* Get a monotonic increasing integer that increments roughly every second
*/
public static int current() {
return tick;
}
Expand Down