advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Download the code for this article
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

Bring Java's System.currentTimeMillis() Back into the Fold for Transaction Monitoring

Many developers need to capture transaction times for high-volume transactional systems, but have avoided using Java's System.currentTimeMillis() due to rumors of poor performance. Find out why currentTimeMillis() has gotten a bad rap.  


advertisement
any developers who work on high-volume transactional software (such as real-time financial or accounting systems) are skeptical of using Java's System.currentTimeMillis() method for capturing transaction times. You'll often hear the suggestion to avoid it due to fear that it will introduce unwanted delay in transaction response time, especially in multi-threaded applications. But don't swallow this advice whole. Although currentTimeMillis can have poor resolution, it generally has great performance.

There are a few things to note about the currentTimeMillis method:

  • It is native
  • Its resolution (or granularity) depends on the underlying OS
  • It generally has a very fast response time
  • The method signature is not synchronized but the implementation usually is

It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?



Javid Jamae consults for Valtech, a global consulting group specializing in delivering advanced technology solutions. Valtech endeavors to help its customers through its global delivery model to create and/or maintain an affordable competitive advantage.
advertisement