Skip to content

Commit

Permalink
Create simple performance-testing function
Browse files Browse the repository at this point in the history
  • Loading branch information
Harrison88 committed Jul 13, 2019
1 parent 12217df commit 00172c6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions website/star_generator/generator/performance.py
@@ -0,0 +1,14 @@
import stars
import timeit

def test(iterations=10):
statement = 'starry_sky.generate_sky()'
setup = 'starry_sky = stars.Sky()'
time = timeit.timeit(statement, setup, number=iterations, globals=globals())

each_iteration = time / iterations
return each_iteration


if __name__ == '__main__':
print(test())

0 comments on commit 00172c6

Please sign in to comment.