Source code for this sample can be found on GitHub.
Example on how to use an event function with an Timer trigger.