Of course, it’s more likely that you’ll want to compare more than two things. You can compare as many function calls as you want with
mark(), as we’ll demonstrate in the following example. It’s probably more likely that you’ll want to compare these function calls against more than one value. For example, in the digest package there are eight different algorithms. Ranging from the standard
md5to the newer
xxhash64methods. To compare times, we’ll generate
n = 20random character strings of length
N = 10,000. This can all be wrapped up in the single function
press()function call from the bench package:
Click through for an example involving hashing algorithms.