pressenter2exit package¶
Module contents¶
-
class
pressenter2exit.
PressEnter2Exit
(message='Enter pressed')¶ Bases:
threading.Thread
Press Enter to Exit class. Facilitates exit of a Python CLI program in a controlled way.
-
get_duration
()¶ time since instantiation
Returns: time since instantiation (in seconds)
-
get_enter_duration
()¶ time from instantiation to when enter was pressed
Returns: time from instantiation to when enter was pressed or None if enter not yet pressed (in seconds)
-
get_reaction_time
()¶ get how long it took the program that uses this class to react to the pressing of enter
Returns: the time from when enter was pressed to now (in seconds)
-
get_start_time
()¶ get time of instantiation (in seconds since epoch)
Returns: time of instantiation (in seconds since epoch)
-
run
()¶ run method
-