SpigotMC/Spigot — pull request #223 by aikar (2014-08-28 03:29:33+00:00)
Title: Improve the Optimized Tick Loop patch

Currently, the tick loop .sleep() call loses precision by not passing the nanoseconds to the call.
This causes the .sleep() method to under sleep MANY times, sometimes taking 10+ iterations to finally tick.

The problem can be seen here: https://gist.github.com/aikar/bebc68a749713b04e1e6

By passing the nanosecond remainder to .sleep(), the system can get much closer to
the desired sleep duration, and complete in 1 to 2 tries.

Additionally, the lastTick was being initialized to now, causing the server to essentially
wait for the first tick. Just set it to -1 tick to make first tick initiate immediately.