last example of chapter 9: classes/vector_v5.py
This commit is contained in:
@@ -11,13 +11,13 @@ else:
|
||||
print('Usage: {} <vector-module-to-test>'.format())
|
||||
sys.exit(1)
|
||||
|
||||
fmt = 'Selected Vector type: {.__name__}.{.__name__}'
|
||||
print(fmt.format(module, module.Vector))
|
||||
fmt = 'Selected Vector2d type: {.__name__}.{.__name__}'
|
||||
print(fmt.format(module, module.Vector2d))
|
||||
|
||||
mem_init = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
|
||||
print('Creating {:,} Vector instances'.format(NUM_VECTORS))
|
||||
print('Creating {:,} Vector2d instances'.format(NUM_VECTORS))
|
||||
|
||||
vectors = [module.Vector(3.0, 4.0) for i in range(NUM_VECTORS)]
|
||||
vectors = [module.Vector2d(3.0, 4.0) for i in range(NUM_VECTORS)]
|
||||
|
||||
mem_final = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
|
||||
print('Initial RAM usage: {:14,}'.format(mem_init))
|
||||
|
||||
Reference in New Issue
Block a user