Skip to content

Commit da9f204

Browse files
authored
Update analyzer.py (#104)
1 parent 7ab5b35 commit da9f204

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

pyseoanalyzer/analyzer.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import time
2-
32
from operator import itemgetter
43
from .website import Website
54

5+
def calc_total_time(start_time):
6+
return time.time() - start_time
67

78
def analyze(
89
url,
@@ -13,14 +14,11 @@ def analyze(
1314
):
1415
start_time = time.time()
1516

16-
def calc_total_time():
17-
return time.time() - start_time
18-
1917
output = {
2018
"pages": [],
2119
"keywords": [],
2220
"errors": [],
23-
"total_time": calc_total_time(),
21+
"total_time": 0, # Initialize to 0 before calculation
2422
}
2523

2624
site = Website(
@@ -80,6 +78,6 @@ def calc_total_time():
8078
output["keywords"], key=itemgetter("count"), reverse=True
8179
)
8280

83-
output["total_time"] = calc_total_time()
81+
output["total_time"] = calc_total_time(start_time)
8482

8583
return output

0 commit comments

Comments
 (0)