Skip to content

Instantly share code, notes, and snippets.

@kozec
Last active June 7, 2017 06:33
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 kozec/a09cfd69bde13101c8ca4717b4f064af to your computer and use it in GitHub Desktop.
Save kozec/a09cfd69bde13101c8ca4717b4f064af to your computer and use it in GitHub Desktop.
from scc.actions import NoAction
from scc.modifiers import SmoothModifier
import timeit, cProfile
class Mapper:
def __init(self):
pass
def is_touched(self, what):
return True
def was_touched(self, what):
return True
m = SmoothModifier(NoAction())
x = 1
def test():
global x
m.whole(Mapper(), x, 10, "A")
x += 1
def test_prof():
global x
while x < 10000:
m.whole(Mapper(), x, 10, "A")
x += 1
print timeit.timeit(test, number = 100000)
# cProfile.run("print test_prof()")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment