private static long spin(long ms){
  long start=threadMXBean.getCurrentThreadCpuTime();
  do {
    long durationMS=(threadMXBean.getCurrentThreadCpuTime() - start) / 1000;
    if (durationMS >= ms) {
      return durationMS;
    }
  }
 while (true);
}

private static long spin ( long ms ) { long start = threadMXBean . getCurrentThreadCpuTime ( ) ; do { long durationMS = ( threadMXBean . getCurrentThreadCpuTime ( ) - start ) / 1000 ; if ( durationMS >= ms ) { return durationMS ; } } while ( true ) ; }
actively spins the current thread for at least a given number of milliseconds in such a way that timers for the current thread keep ticking over .
