Skip to content

Commit a67a204

Browse files
committed
update of Python version of performance test
1 parent bcf778b commit a67a204

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

perftests/countDistinctWords.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
def countDistictWords(filename):
2626

27-
start = time.clock()
27+
start = time.perf_counter()
2828

2929
# Step 1: Read the entire book into a string.
3030
try:
@@ -40,7 +40,7 @@ def countDistictWords(filename):
4040
contents = contents.replace(c, ' ')
4141
contents = contents.lower()
4242

43-
# Step 3: Split the ftlString up into an array of words.
43+
# Step 3: Split the string into a list of words.
4444
words = contents.split()
4545
print('Number of words: %i'%(len(words)))
4646

@@ -53,7 +53,7 @@ def countDistictWords(filename):
5353
wordOcc[word] = 1
5454
print('Number of distinct words: %i'%(len(wordOcc)))
5555

56-
finish = time.clock()
56+
finish = time.perf_counter()
5757
print('Counted all distinct words in %s in %f s'%(filename, finish-start))
5858

5959

0 commit comments

Comments
 (0)