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):
|
||||
global startTime
|
||||
startTime = time.process_time()
|
||||
if timeit:
|
||||
startTime = time.process_time()
|
||||
|
||||
def endTimer(timeit, msg):
|
||||
global startTime
|
||||
endTime = time.process_time()
|
||||
if (timeit):
|
||||
if timeit:
|
||||
endTime = time.process_time()
|
||||
write(msg, endTime - startTime, file=sys.stderr)
|
||||
startTime = None
|
||||
|
||||
|
|
Loading…
Reference in New Issue