small but important improvment, should try preformance.now and rewrite all time logic...