Skip to content
Permalink
Browse files Browse the repository at this point in the history
Replace deprecated function to add Python 3.8 support. Fixes issue #180
"The function time.clock() has been removed, after having been deprecated since Python 3.3: use time.perf_counter() or time.process_time() instead, depending on your requirements, to have well-defined behavior."
https://docs.python.org/3/whatsnew/3.8.html
https://bugs.python.org/issue36895
  • Loading branch information
pyrescene committed Dec 8, 2019
1 parent 6f0e374 commit 0f72c46
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions resample/srs.py
Expand Up @@ -268,7 +268,7 @@ def pexit(status, msg="", error_print=True):
sample = resample.sample_class_factory(ftype_arg0)
is_music = ftype_arg0 in (FileType.FLAC, FileType.MP3)

t0 = time.clock()
t0 = time.time()

# for Windows long path work around
args0 = ""
Expand Down Expand Up @@ -438,7 +438,7 @@ def pexit(status, msg="", error_print=True):
# 1) Read in the SRS file
srs_data, tracks = sample.load_srs(srs)

t1 = time.clock()
t1 = time.time()
total = t1 - t0
print("SRS Load Complete... "
"Elapsed Time: {0:.2f}s".format(total))
Expand All @@ -455,7 +455,7 @@ def pexit(status, msg="", error_print=True):
options.no_stored_match_offset or len(sample.cut_data)):
tracks = movi.find_sample_streams(tracks, movie)

t1 = time.clock()
t1 = time.time()
total = t1 - t0
print("Track Location Complete... "
"Elapsed Time: {0:.2f}s".format(total))
Expand All @@ -473,7 +473,7 @@ def pexit(status, msg="", error_print=True):

# 3) Extract those sample streams to memory
tracks, attachments = movi.extract_sample_streams(tracks, movie)
t1 = time.clock()
t1 = time.time()
total = t1 - t0
print("Track Extraction Complete... "
"Elapsed Time: {0:.2f}s".format(total))
Expand All @@ -497,7 +497,7 @@ def pexit(status, msg="", error_print=True):
pexit(1, "\nOperation aborted.\n", False)

def show_attempt_info(sfile):
t1 = time.clock()
t1 = time.time()
total = t1 - t0
print("Rebuild Complete... "
"Elapsed Time: {0:.2f}s".format(total))
Expand Down Expand Up @@ -550,7 +550,7 @@ def check_tracks(current_track, others, v):
# extract streams on current offets
v.tracks, v.attachments = (movi
.extract_sample_streams(v.tracks, movie))
t1 = time.clock()
t1 = time.time()
total = t1 - t0
print("Track Extraction Complete... "
"Elapsed Time: {0:.2f}s".format(total))
Expand Down

0 comments on commit 0f72c46

Please sign in to comment.