Skip to content

Commit

Permalink
Merge pull request #19 from FoamyGuy/ms_instead_of_ns
Browse files Browse the repository at this point in the history
use ms and seconds instead of ns.
  • Loading branch information
FoamyGuy authored Nov 19, 2024
2 parents 2e32d68 + 47fc498 commit 3909d8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adafruit_ducky.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def loop( # pylint: disable=too-many-return-statements
) -> bool: # pylint: disable=too-many-branches
"""Function that sends a line of the DuckyScript file over hid every time it is called"""

now = time.monotonic_ns()
now = time.monotonic()
if now < self.wait_until:
return True

Expand Down Expand Up @@ -179,12 +179,12 @@ def loop( # pylint: disable=too-many-return-statements

if start in ("DEFAULT_DELAY", "DEFAULTDELAY"):
self.wait_until -= self.default_delay
self.default_delay = int(words[1]) * 1000000
self.default_delay = int(words[1]) / 1000
self.wait_until += self.default_delay
return True

if start == "DELAY":
self.wait_until += int(words[1]) * 1000000
self.wait_until += int(words[1]) / 1000
return True

if start == "STRING":
Expand Down

0 comments on commit 3909d8f

Please sign in to comment.