Try using Benchmark.js