Completely remove "walltime" variable and use time.time() directly

This commit is contained in:
Eduard Braun 2018-03-26 22:34:11 +02:00
parent b622642aa1
commit d508f59aa6

View file

@ -74,12 +74,6 @@ VER = __version__
COPYRIGHT = u'Copyright Jeff Schiller, Louis Simard, 2010' COPYRIGHT = u'Copyright Jeff Schiller, Louis Simard, 2010'
# the walltime measurement function, we will use for reporting
# reporting how long it took to process a given SVG file. For our
# purposes, the time.time() function has sufficent accuracy.
walltime = time.time
NS = {'SVG': 'http://www.w3.org/2000/svg', NS = {'SVG': 'http://www.w3.org/2000/svg',
'XLINK': 'http://www.w3.org/1999/xlink', 'XLINK': 'http://www.w3.org/1999/xlink',
'SODIPODI': 'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd', 'SODIPODI': 'http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd',
@ -3865,7 +3859,7 @@ def start(options, input, output):
# sanitize options (take missing attributes from defaults, discard unknown attributes) # sanitize options (take missing attributes from defaults, discard unknown attributes)
options = sanitizeOptions(options) options = sanitizeOptions(options)
start = walltime() start = time.time()
# do the work # do the work
in_string = input.read() in_string = input.read()
@ -3878,7 +3872,7 @@ def start(options, input, output):
if not ((output is sys.stdout) or (hasattr(sys.stdout, 'buffer') and output is sys.stdout.buffer)): if not ((output is sys.stdout) or (hasattr(sys.stdout, 'buffer') and output is sys.stdout.buffer)):
output.close() output.close()
end = walltime() end = time.time()
# run-time in ms # run-time in ms
duration = int(round((end - start) * 1000.)) duration = int(round((end - start) * 1000.))