Quick actions

cmd+k|ctrl+k

Navigation

Languages

Finding Nemo

Snippet info

Language

Python

Visibility

public

Author

jonesis

Created

2025-05-07T00:35:37.643195Z

Updated

2025-05-07T00:35:37.643195Z

import time

nemo = ["nemo"] * 100000

def findNemo(array):
    for item in array:
        if item == "nemo":
            print("Found NEMO!")

start = time.perf_counter()
findNemo(nemo)
end = time.perf_counter()

print(f'Call to find Nemo took {(end - start) * 1000:.2f} milliseconds')
INFO