Does Python have a timer mechanism? i.e. an "after 500 milliseconds, run this bit of code" sort of thing?