Base the decision to display either the interface name or essid
on a time interval rather than how many times the update() function
is called. The time interval is chosen to be 2 seconds.
The old logic would swap the display after update() was called
50 times. If 'interval' between updates is a sane value around 1 second,
it would take 50 seconds to swap the name on display.
I noticed using powertop that the number of wakeups per second
generated by wmwifi did not correlate well with the update interval,
where I'd expect approximately 1 wakeup if the update interval was 1 sec.
Strangely enough, calling the function
dockapp_nextevent_or_timeout(&event, update_interval * 1000)
in the main loop (note that I already replaced * 100 by * 1000 above)
with update_interval = 1 generates around 15 wakeups/sec here.
Calling usleep() in the loop instead leads to fewer wakeups, around 1/sec.
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>