Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@greymeister
Created April 16, 2015 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greymeister/eb388d7a55febb3327fc to your computer and use it in GitHub Desktop.
Save greymeister/eb388d7a55febb3327fc to your computer and use it in GitHub Desktop.
Sufficient Suffixes
private static int counter = 0;
private static synchronized java.lang.String getUniqueSuffix() {
// reset the counter if it is greater than 99999
if (counter > 99999) {
counter = 0;
}
counter = counter + 1;
return java.lang.Long.toString(java.lang.System.currentTimeMillis()) + "_" + counter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment