diff --git a/src/openseadragon.js b/src/openseadragon.js index c00673c8..ab4b6961 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -635,6 +635,20 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ }, + /** + * Returns the current milliseconds, using Date.now() if available + * @name $.now + * @function + */ + now: function( ) { + if (Date.now) { + return Date.now(); + } + + return new Date().getTime(); + }, + + /** * An enumeration of Browser vendors including UNKNOWN, IE, FIREFOX, * SAFARI, CHROME, and OPERA.