Skip to content

Commit f9df0ce

Browse files
authored
update time.clock to time.process_time (#44)
1 parent 97d20c4 commit f9df0ce

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ python:
77
- "3.4"
88
- "3.5"
99
- "3.6"
10+
- "3.7"
11+
- "3.8"
1012
# command to install dependencies
1113
install:
1214
- "pip install -r requirements.txt"

submit.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
# Python 3:
2222
try:
23+
from time import process_time
2324
from urllib.parse import urlparse, urlencode
2425
from urllib.request import urlopen, Request
2526
from urllib.error import HTTPError
@@ -29,6 +30,8 @@
2930
import sys
3031
# Python 2:
3132
if sys.version_info < (3, 0):
33+
def process_time():
34+
return time.clock()
3235
def input(str):
3336
return raw_input(str)
3437

@@ -214,7 +217,7 @@ def output(input_file, solver_file):
214217

215218
solution = ''
216219

217-
start = time.clock()
220+
start = process_time()
218221
try:
219222
solution = pkg.solve_it(load_input_data(input_file))
220223
except Exception as e:
@@ -224,7 +227,7 @@ def output(input_file, solver_file):
224227
print(str(e))
225228
print('')
226229
return 'Local Exception =('
227-
end = time.clock()
230+
end = process_time()
228231

229232
if not (isinstance(solution, str) or isinstance(solution, unicode)):
230233
print('Warning: the solver did not return a string. The given object will be converted with the str() method.')

0 commit comments

Comments
 (0)