Hacker News new | ask | show | jobs
by enturn 2516 days ago
Whenever talking about UI animations it's important to observe the Best Practices for Response Times and Latency [1] especially if the animation is in addition to a network request. Latency over 300ms might result in a degraded user experience depending on the situation.

1. https://github.com/Tendrl/documentation/wiki/Best-Practices-...

1 comments

>0.2 sec gives the felling of instantaneous response

This is obviously false. Ideally test with an Arduino or other hard-realtime capable system, but assuming your computer doesn't have absolutely terrible latency you can still test with it. Disable your compositor if you're using one, and use a low latency terminal with uncapped framerate like xterm.

The popular method of running "sleep 0.1" alone is not actually a fair test, because a newline is printed immediately on running the command, so you might just be seeing the flicker and not the latency. A better method is comparing:

  read -n1 -s -p "Press a key: " ; sleep 0.0; echo -n "0.0" ; sleep 2 ; echo ""
  read -n1 -s -p "Press a key: " ; sleep 0.1; echo -n "0.1" ; sleep 2 ; echo ""
To me the difference is clearly visible.