Friday, 15 May 2015

Java milli second precision -


What is a suggestion to use for a Java API / system System.currentTimeMillis () - two later requirements At the time of sleep, 1 MMS should be given two separate times - I currently have to sleep for 15 ms to get different time.

Do not try to use time to create unique values ​​Recor A unique ID (key field I'm assuming) use the database to generate. Either use an auto incremental field or create a separate table with a single record of the counter, which you can lock and update safely.

When you can get a solution that works, the resources will eventually catch up with you.


No comments:

Post a Comment