Hello,
 
I am using log4j to help me record the execution times of several functions (1 
to n) using code similar to the following snippet:  
 
logger.debug("Timestamp before...");
function_n();
logger.debug("Timestamp after...");
 
 
For most of the functions I get execution time of 0ms. This is despite the fact 
that these functions are quite different from one another. The remaining few 
functions have execution time of 15 or 16ms. This is also despite the fact that 
these functions are also quite different from one another. 
 
So my questions are:
 
1. what exactly is the precision of the timestamps generated by Log4j?
 
I am using Win XP and am aware that  each timer tick is recorded every 15.625 
milliseconds (http://www.lochan.org/2005/keith-cl/useful/win32time.html). 
 
2. Is there a way I can improve the precision of the timestamps in my Java 
program? 
 
Any feedback will be appreciated
 
Sana


      

Reply via email to