I don't know it's just my experience or not, but every time I type a wrong password in terminal, it takes 2 or 3 seconds to respond. And I think It's a very long time for a computer. Does anybody know the reason?
This is a security feature. Your machine can hash and check the password near instantly. To prevent someone from trying to brute force the password there is an intentional delay added in.
The delay is done in a few common ways. One, as you describe, is to add a couple seconds to any wrong input. Another is to add a longer delay after several wrong attempts (this is common on web interfaces). A third is to use some sort of exponential back off, so the more attempts the longer the delay. Finally, some systems just lock you out after a small but meaningful number of attempts.