improved getTickCount