title: How to suspend a java thread for a small period of time, like 100 nanoseconds?
body: <p>I know <strong>Thread.sleep()</strong> can make a java thread suspend for a while, like certain milliseconds and certain nanoseconds. But the problem is the invocation of this function also causes overhead. </p>
  
  <p>For example, if I want a thread to suspend for 100 nanoseconds, and I call <strong>Thread.sleep(0, 100)</strong>. The whole cost for this process is <strong>invocation_cost + 100 nanosceonds</strong>, which may be much larger the what I want. How could I avoid this problem, and achieve my purpose? </p>
  
  <p>The reason I need this is that I want to do simulation offline. I profiled the execution time of a task; Now I want to simulate this execution time by suspending a thread in the same time period.</p>
  
  <p>Thanks!</p>