We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ab5b35 commit da9f204Copy full SHA for da9f204
1 file changed
pyseoanalyzer/analyzer.py
@@ -1,8 +1,9 @@
1
import time
2
-
3
from operator import itemgetter
4
from .website import Website
5
+def calc_total_time(start_time):
6
+ return time.time() - start_time
7
8
def analyze(
9
url,
@@ -13,14 +14,11 @@ def analyze(
13
14
):
15
start_time = time.time()
16
- def calc_total_time():
17
- return time.time() - start_time
18
19
output = {
20
"pages": [],
21
"keywords": [],
22
"errors": [],
23
- "total_time": calc_total_time(),
+ "total_time": 0, # Initialize to 0 before calculation
24
}
25
26
site = Website(
@@ -80,6 +78,6 @@ def calc_total_time():
80
78
output["keywords"], key=itemgetter("count"), reverse=True
81
79
)
82
83
- output["total_time"] = calc_total_time()
+ output["total_time"] = calc_total_time(start_time)
84
85
return output
0 commit comments