Skip to content

Commit

Permalink
show timing of test_post
Browse files Browse the repository at this point in the history
  • Loading branch information
𝐢𝐁𝐮𝐠 ♦ committed Jan 22, 2019
1 parent 167fb7f commit 8c1df40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions findspam.py
Expand Up @@ -9,6 +9,7 @@
from itertools import chain
from collections import Counter
from datetime import datetime
import time
import os
import os.path as path

Expand Down Expand Up @@ -294,6 +295,7 @@ def reload_blacklists(cls):

@staticmethod
def test_post(post):
start_time = time.time()
result = []
why_title, why_username, why_body = [], [], []
for rule in FindSpam.rules:
Expand All @@ -310,6 +312,8 @@ def test_post(post):
result = list(set(result))
result.sort()
why = "\n".join(why_title + why_username + why_body).strip()
end_time = time.time()
log('debug', "Scanning took {} seconds".format(end_time - start_time))
return result, why

@staticmethod
Expand Down

0 comments on commit 8c1df40

Please sign in to comment.