added a periodic worker

The periodic worker will call a function periodically based on an input duration
your conscientiousness does you credit, I often get lazy and just skip error checking in those cases. I should stop doing that.