Is Javascript “caching” operations?
问题 I was implementing the Levenshtein distance function in Javascript, and I was wondering how much time it takes to run it with Wikedia's example ("sunday" & "saturday"). So I used console.time() and console.timeEnd() to determine the time spent for the function execution. for (var i = 0; i < 15; i++) { console.time("benchmark" + i); var result = LevenshteinDistance("sunday", "saturday"); console.timeEnd("benchmark" + i); } Since it was fluctuating between 0.4ms and 0.15ms, I used a loop and I