Skip to content

Instantly share code, notes, and snippets.

@adrianmarkperea
Created October 19, 2019 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianmarkperea/2c2d2d9639ab80c6ad0e4a6da2d88ead to your computer and use it in GitHub Desktop.
Save adrianmarkperea/2c2d2d9639ab80c6ad0e4a6da2d88ead to your computer and use it in GitHub Desktop.
import numpy as np
rng = np.random.RandomState(0)
# Create a lot of numbers
nums = rng.random(10000000)
# Decorate np.sort with our time_it transformer
timed_sort = time_it(np.sort)
# Perform the sort with our time_it functionality
timed_sort(nums)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment