From 7c9502b99e82d54b00ba9fdd540455a17b2e12b6 Mon Sep 17 00:00:00 2001 From: norhh Date: Wed, 7 Oct 2020 14:43:18 +0530 Subject: [PATCH 1/2] use nano seconds --- mythril/analysis/report.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mythril/analysis/report.py b/mythril/analysis/report.py index 474a055b..21d3ecf5 100644 --- a/mythril/analysis/report.py +++ b/mythril/analysis/report.py @@ -287,11 +287,12 @@ class Report: meta_data.update(self._get_exception_data()) # Add execution info to meta - meta_data["mythril_execution_info"] = {} + meta_data["mythril_execution_info"] = { + "analysis_duration": (time() - StartTime().global_start_time) * (10 ** 9) + } for execution_info in self.execution_info: meta_data["mythril_execution_info"].update(execution_info.as_dict()) - meta_data["mythril_analysis_duration"] = time() - StartTime().global_start_time result = [ { "issues": _issues, From 490c4a87d60eb7e7c987ac9e503ce1d007260f87 Mon Sep 17 00:00:00 2001 From: norhh Date: Tue, 13 Oct 2020 14:50:07 +0530 Subject: [PATCH 2/2] Round to integers --- mythril/analysis/report.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mythril/analysis/report.py b/mythril/analysis/report.py index 21d3ecf5..6712d573 100644 --- a/mythril/analysis/report.py +++ b/mythril/analysis/report.py @@ -287,9 +287,10 @@ class Report: meta_data.update(self._get_exception_data()) # Add execution info to meta - meta_data["mythril_execution_info"] = { - "analysis_duration": (time() - StartTime().global_start_time) * (10 ** 9) - } + analysis_duration = int( + round((time() - StartTime().global_start_time) * (10 ** 9)) + ) + meta_data["mythril_execution_info"] = {"analysis_duration": analysis_duration} for execution_info in self.execution_info: meta_data["mythril_execution_info"].update(execution_info.as_dict())