Use requestAnimationFrame for frame() callback
Get current timestamp in an optimized way