updated serverloop to count milliseconds