Back to index

python3.2  3.2.2
Functions | Variables
clockres Namespace Reference

Functions

def clockres

Variables

float TEST_TIME = 1.0

Function Documentation

def clockres.clockres (   timer)

Definition at line 14 of file clockres.py.

00014 
00015 def clockres(timer):
00016     d = {}
00017     wallclock = time.time
00018     start = wallclock()
00019     stop = wallclock() + TEST_TIME
00020     spin_loops = range(1000)
00021     while 1:
00022         now = wallclock()
00023         if now >= stop:
00024             break
00025         for i in spin_loops:
00026             d[timer()] = 1
00027     values = sorted(d.keys())
00028     min_diff = TEST_TIME
00029     for i in range(len(values) - 1):
00030         diff = values[i+1] - values[i]
00031         if diff < min_diff:
00032             min_diff = diff
00033     return min_diff

Here is the call graph for this function:


Variable Documentation

float clockres.TEST_TIME = 1.0

Definition at line 12 of file clockres.py.