I have a function inside a for loop and I want to increase the number of time the loop runs if my function returns value before 1 second. how can I implement this in JavaScript?
This is for benchmarking purpose. In golang testing library same is done using b.N in a for loop so I want to implement the same.