      1 /**
      2  * @ignore
      3  */
      4 var Ozone = Ozone || {};
      5 /**
      6  * @ignore
      7  */
      8 Ozone.util = Ozone.util || {};
      9 /**
     10  * @namespace
     11  */
     12 Ozone.util.pageLoad = Ozone.util.pageLoad || {};
     13
     14 /**
     15  * @field
     16  * @description enable or disable the automatic sending of loadtime
     17  */
     18 Ozone.util.pageLoad.autoSend = true;
     19
     20 /**
     21  * @field
     22  * @description holds the current date time, before the onload of the widget
     23  */
     24 Ozone.util.pageLoad.beforeLoad = (new Date()).getTime();
     25
     26 /**
     27  * @field
     28  * @description holds current date time after the onload of the widget.  this value will be set after onload
     29  */
     30 Ozone.util.pageLoad.afterLoad = null;
     31
     32
     33 Ozone.util.pageLoad.calcLoadTime = function(time) {
     34   /**
     35    * @field
     36    * @description Holds the load time of the widget.  This may be altered to allow the widget to determine it's load time.
     37    *   loadTime is sent via the Eventing API, if altering this value do so before Eventing is initialized
     38    */
     39   Ozone.util.pageLoad.loadTime = (time != null ? time : Ozone.util.pageLoad.afterLoad) - Ozone.util.pageLoad.beforeLoad;
     40   return Ozone.util.pageLoad.loadTime;
     41 };
     42