You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that when I use stopwatch / clock mode, termdown loads CPU almost to 100%. This is not how a simple stopwatch should behave. Timer mode is fine.
Below see some profiling data obtained using perf tool for stopwatch, timer and bash sleep function.
Note the task-clock and CPU clock frequency. The difference is also noticable for cooler fan noise.
I think using sleep in the while loop is a reasonable solution, it seems it's used already for a similar purpose in input_thread_body. If you don't mind, I might write a pull request later today.
Will need to investigate more. We probably end up sleeping for zero seconds for a number of iterations each second, depending on when within a second we started the program, hence the wildly varying amount of CPU utilization:
> time termdown -zq 10
10.010 10 total
real 0m10.143s
user 0m1.772s
sys 0m0.041s
> time termdown -zq 10
10.011 10 total
real 0m10.132s
user 0m8.829s
sys 0m0.068s
> time termdown -zq 10
10.011 10 total
real 0m10.136s
user 0m6.246s
sys 0m0.072s
Hello
I noticed that when I use stopwatch / clock mode, termdown loads CPU almost to 100%. This is not how a simple stopwatch should behave. Timer mode is fine.
Below see some profiling data obtained using
perf
tool for stopwatch, timer and bash sleep function.Note the
task-clock
and CPU clock frequency. The difference is also noticable for cooler fan noise.I managed to fix it by putting
sleep(.2)
inwhile
loop in stopwatch. I'm not sure this is the right way to mitigate the problem, though.Here're the stats for the modified termdown installed from source:
My system:
The text was updated successfully, but these errors were encountered: