JS util to test speed of functions