This question already has an answer here:
In both my Linux and OSX machines when I type in the password to login, a correct password is accepted immediately. However, if I type a wrong password, checking process takes much longer.
How is the process of password authentication in a UNIX machine?
Note: I have experienced this in Gnome3, Gnome2, Unity and different versions of OSX. That's why I believe it is not about some fancy animations that desktop environments have to alert a wrong password.