Reorganize

This commit is contained in:
Daniel Mills
2020-07-27 20:48:00 -04:00
parent e1067aeb83
commit dddbcdf088
138 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package ninja.bytecode.iris.util;
public class ChronoLatch
{
private long interval;
private long since;
public ChronoLatch(long interval, boolean openedAtStart)
{
this.interval = interval;
since = System.currentTimeMillis() - (openedAtStart ? interval * 2 : 0);
}
public ChronoLatch(long interval)
{
this(interval, true);
}
public boolean flip()
{
if(System.currentTimeMillis() - since > interval)
{
since = System.currentTimeMillis();
return true;
}
return false;
}
}