See described here:
http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp
The selenium lib in Java, python, ruby, etc. all support it, and it seems quite easy to implement.
For example see the python implementation:
https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/support/wait.py
Thanks!