tartley / rerun2

Rerun a given command (eg tests) on filesystem events
MIT License
98 stars 21 forks source link

remove bc, use integer math for ignore_secs #12

Closed milahu closed 2 years ago

milahu commented 2 years ago

test: https://replit.com/@milahu/math-integer-float-sh

tartley commented 2 years ago

Hi. Brilliant, thanks for submitting. Just so I understand what's going on: The goal of this change is to avoid starting 'bc' as a separate process, for performance reasons, is that right? Are there other goals you had in mind?

milahu commented 2 years ago

my motivation is to avoid the dependency for example, on nixos linux, bc is not installed by default

performance is not relevant as this code executes only all 0.25 seconds or so

see also

How do I use floating-point arithmetic in bash?

Fixed-point arithmetic

tartley commented 2 years ago

OK, I get it, thanks. Brilliant.