Did some copy/pasting for the MS setInterval sample page, will try to some how adapt it to a generic sleep/wait type function.