From 3d9cee96c305372997dfd2fccde04750bcf88726 Mon Sep 17 00:00:00 2001 From: Andre Wisplinghoff Date: Sun, 1 Dec 2024 16:04:08 +0100 Subject: [PATCH] Fix regex match_time output (#1488) --- presidio-analyzer/presidio_analyzer/pattern_recognizer.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/presidio-analyzer/presidio_analyzer/pattern_recognizer.py b/presidio-analyzer/presidio_analyzer/pattern_recognizer.py index a092da922..698293481 100644 --- a/presidio-analyzer/presidio_analyzer/pattern_recognizer.py +++ b/presidio-analyzer/presidio_analyzer/pattern_recognizer.py @@ -196,10 +196,9 @@ def __analyze_patterns( matches = pattern.compiled_regex.finditer(text) match_time = datetime.datetime.now() - match_start_time logger.debug( - "--- match_time[%s]: %s.%s seconds", + "--- match_time[%s]: %.6f seconds", pattern.name, - match_time.seconds, - match_time.microseconds, + match_time.total_seconds() ) for match in matches: