From 7ad60c71fe2195b96b6b4ead714fb05fb1340c19 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Fri, 11 Jul 2025 22:01:11 -0400 Subject: [PATCH] Add unlock duration timer --- src/password_manager/manager.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/password_manager/manager.py b/src/password_manager/manager.py index e7b5349..9b0a948 100644 --- a/src/password_manager/manager.py +++ b/src/password_manager/manager.py @@ -133,6 +133,7 @@ class PasswordManager: self.secret_mode_enabled: bool = False self.clipboard_clear_delay: int = 45 self.profile_stack: list[tuple[str, Path, str]] = [] + self.last_unlock_duration: float | None = None # Initialize the fingerprint manager first self.initialize_fingerprint_manager() @@ -225,6 +226,7 @@ class PasswordManager: def unlock_vault(self) -> None: """Prompt for password and reinitialize managers.""" + start = time.perf_counter() if not self.fingerprint_dir: raise ValueError("Fingerprint directory not set") self.setup_encryption_manager(self.fingerprint_dir) @@ -233,6 +235,13 @@ class PasswordManager: self.locked = False self.update_activity() self.sync_index_from_nostr() + self.last_unlock_duration = time.perf_counter() - start + print( + colored( + f"Vault unlocked in {self.last_unlock_duration:.2f} seconds", + "yellow", + ) + ) def initialize_fingerprint_manager(self): """