Make genvk.py work in Python2 (#894)
As a quick workaround, the Python3-specific function time.process_time() is conditioned to the `timeit` parameter. Indeed, if this parameter is not set, there is no point in getting the process time anyway. Unblocks rolling Vulkan dependencies in Google's ANGLE. Signed-off-by: Shahbaz Youssefi <syoussefi@google.com>
This commit is contained in:
parent
1c87a7149c
commit
b59ff9c1fe
|
@ -30,12 +30,13 @@ startTime = None
|
||||||
|
|
||||||
def startTimer(timeit):
|
def startTimer(timeit):
|
||||||
global startTime
|
global startTime
|
||||||
|
if timeit:
|
||||||
startTime = time.process_time()
|
startTime = time.process_time()
|
||||||
|
|
||||||
def endTimer(timeit, msg):
|
def endTimer(timeit, msg):
|
||||||
global startTime
|
global startTime
|
||||||
|
if timeit:
|
||||||
endTime = time.process_time()
|
endTime = time.process_time()
|
||||||
if (timeit):
|
|
||||||
write(msg, endTime - startTime, file=sys.stderr)
|
write(msg, endTime - startTime, file=sys.stderr)
|
||||||
startTime = None
|
startTime = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue