I want to use the result of System.currentTimeMillis()
in the multithreaded appplication to generate unique IDs. This is my code:
class MyRunnableClass implements Runnable{
@Override
public void run() {
long thisValueShouldBeUnique = System.currentTimeMillis ();
}
}
I start 10 threads which run MyRunnableClass object run() method.
Is it true, that sometimes the result of System.currentTimeMillis ()
in different threads may be the same?