change from getTime to random

tested (on Chrome) and Math.random() * length was faster than new
Date().getTime() % length