Implement `timer` for Mac OS X.