Last active
December 26, 2015 06:29
-
-
Save frafra/7107667 to your computer and use it in GitHub Desktop.
Calculate interval between two clicks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DEV="/dev/input/mouse0" | |
SEQ="ht nul nul" | |
function click_event { | |
stdbuf -oL od -w3 -t a -A n "$DEV" | grep -m1 "$SEQ" > /dev/null | |
} | |
click_event | |
start=$(date +%s.%N) | |
click_event | |
stop=$(date +%s.%N) | |
echo $stop-$start | bc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment