AppFolio interview question

How would you implement a feature like JavaScript's setTimeout() in any language other than JavaScript?