Safer way to wait amount of time I'm writing a helper for asynchronous operations.
By default, winjs does not provide a way to wait x seconds before the execution of another function. So I decided to write a helper.

(function asyncOperation() {
    "use strict";


    // -------------------------------------------------------------------
    //   awaitTime(time_milliseconde)
    //  Description:
    //   Waits a specified amount of time.
    //  Returns:
    //   //
    //  Usage:
    //   foo.helpers.asyncOperation.awaitTime(1000).done(function(){
    //      //your logic
    //   });
    //
    // -------------------------------------------------------------------
    function awaitTime(milliseconds) {
        if(!milliseconds || +milliseconds) {
            // need to ensure that milliseconds can be used
            milliseconds = 0;
        }

        // create a new promise and use set time out to wait x milliseconds.
        return new WinJS.Promise(function (complete) {
            setTimeout(function () {
                // informe the promise that it ended.
                complete();
            }, milliseconds);
        });
    }

    WinJS.Namespace.define("foo.helpers.asyncOperation", {
        awaitTime: awaitTime
    });
})();


I want my code to be as safe as possible. That's why I'm using "+value" in my "if". 
I saw that in some cases the performance of the setTimeout is not good. 
Also, is it better to define the function and assign it to the namespace at the end? (http://msdn.microsoft.com/en-us/library/windows/apps/hh967793.aspx) 

So, I want to know if my code can be refactored/safer.
I think WinJS already provides this:

WinJS.Promise.timeout(timeout) creates a promise that is completed asynchronously after the specified timeout, essentially wrapping a call to setTimeout within a promise. 

See also  http://msdn.microsoft.com/en-us/library/windows/apps/br229729.aspx

If you wish to continue with your own function, then you should review how promises ought to work, I don't think you are using the promises object the way it was intended.