Created
April 16, 2015 22:31
-
-
Save greymeister/eb388d7a55febb3327fc to your computer and use it in GitHub Desktop.
Sufficient Suffixes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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