Skip to content

Commit 6213bb6

Browse files
authored
Use time.perf_counter instead of deprecated time.clock for Python 3 compatibility. (#51)
1 parent e734030 commit 6213bb6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rma/cli/rma_cli.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/usr/bin/env python
2-
import time
2+
try:
3+
from time import perf_counter as time_clock
4+
except ImportError:
5+
from time import clock as time_clock
36
import logging
47
import sys
58
from argparse import ArgumentParser, HelpFormatter
@@ -98,10 +101,10 @@ def main():
98101
match=options.match, limit=options.limit, filters=filters, format=options.format,
99102
separator=options.separator)
100103

101-
start_time = time.clock()
104+
start_time = time_clock()
102105
app.run()
103106

104-
sys.stderr.write("\r\nDone in %s seconds" % (time.clock() - start_time))
107+
sys.stderr.write("\r\nDone in %s seconds" % (time_clock() - start_time))
105108

106109
if __name__ == '__main__':
107110
main()

0 commit comments

Comments
 (0)