Skip to content

Instantly share code, notes, and snippets.

@BinRoot
Created May 13, 2013 19:31
Show Gist options
  • Select an option

  • Save BinRoot/5570832 to your computer and use it in GitHub Desktop.

Select an option

Save BinRoot/5570832 to your computer and use it in GitHub Desktop.
private static long getNextTime(int timesPerDay) {
ExponentialRandomVariable exponentialRandomVariable = new ExponentialRandomVariable(1.0/((double)timesPerDay));
double x = exponentialRandomVariable.nextRandomVariable();
long ms = (long)(x * 86400000);
return ms;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment