Back to index

python3.2  3.2.2
Functions | Variables
test.time_hashlib Namespace Reference

Functions

def creatorFunc
def test_scaled_msg
def test_create
def test_zero

Variables

list hName = sys.argv[1]
tuple creatorFunc = getattr(hashlib, hName)

Function Documentation

Definition at line 8 of file time_hashlib.py.

00008 
00009 def creatorFunc():
00010     raise RuntimeError("eek, creatorFunc not overridden")

Definition at line 23 of file time_hashlib.py.

00023 
00024 def test_create():
00025     start = time.time()
00026     for f in range(20000):
00027         d = creatorFunc()
00028     end = time.time()
00029 
00030     print(('%2.2f' % (end-start)), "seconds", '[20000 creations]')

def test.time_hashlib.test_scaled_msg (   scale,
  name 
)

Definition at line 11 of file time_hashlib.py.

00011 
00012 def test_scaled_msg(scale, name):
00013     iterations = 106201/scale * 20
00014     longStr = 'Z'*scale
00015 
00016     localCF = creatorFunc
00017     start = time.time()
00018     for f in range(iterations):
00019         x = localCF(longStr).digest()
00020     end = time.time()
00021 
00022     print(('%2.2f' % (end-start)), "seconds", iterations, "x", len(longStr), "bytes", name)

Definition at line 31 of file time_hashlib.py.

00031 
00032 def test_zero():
00033     start = time.time()
00034     for f in range(20000):
00035         x = creatorFunc().digest()
00036     end = time.time()
00037 
00038     print(('%2.2f' % (end-start)), "seconds", '[20000 "" digests]')
00039 
00040 


Variable Documentation

Definition at line 59 of file time_hashlib.py.

Definition at line 41 of file time_hashlib.py.