client/boomerang-rt.js
function(ename, data) {
		var t_start;
		if(ename==="xhr") {
			if(data && data.name && impl.timers[data.name]) {
				// For xhr timers, t_start is stored in impl.timers.xhr_{page group name}
				// and xhr.pg is set to {page group name}
				t_start = impl.timers[data.name].start;
			}
			else if(data && data.timing && data.timing.requestStart) {
				// For automatically instrumented xhr timers, we have detailed timing information
				t_start = data.timing.requestStart;
			}
			BOOMR.addVar("rt.start", "manual");
		}
		else if(impl.navigationStart) {
			t_start = impl.navigationStart;
		}
		else if(impl.t_start && impl.navigationType !== 2) {
			t_start = impl.t_start;			// 2 is TYPE_BACK_FORWARD but the constant may not be defined across browsers
			BOOMR.addVar("rt.start", "cookie");	// if the user hit the back button, referrer will match, and cookie will match
		}						// but will have time of previous page start, so t_done will be wrong
		else if(impl.cached_t_start) {
			t_start = impl.cached_t_start;
		}
		else {
			BOOMR.addVar("rt.start", "none");
			t_start = undefined;			// force all timers to NaN state
		}

		BOOMR.debug("Got start time: " + t_start, "rt");
		impl.cached_t_start = t_start;

		return t_start;
	}
function(ename, data) {
		var t_start;
		if(ename==="xhr") {
			if(data && data.name && impl.timers[data.name]) {
				// For xhr timers, t_start is stored in impl.timers.xhr_{page group name}
				// and xhr.pg is set to {page group name}
				t_start = impl.timers[data.name].start;
			}
			else if(data && data.timing && data.timing.requestStart) {
				// For automatically instrumented xhr timers, we have detailed timing information
				t_start = data.timing.requestStart;
			}
			BOOMR.addVar("rt.start", "manual");
		}
		else if(impl.navigationStart) {
			t_start = impl.navigationStart;
		}
		else if(impl.t_start && impl.navigationType !== 2) {
			t_start = impl.t_start;			// 2 is TYPE_BACK_FORWARD but the constant may not be defined across browsers
			BOOMR.addVar("rt.start", "cookie");	// if the user hit the back button, referrer will match, and cookie will match
		}						// but will have time of previous page start, so t_done will be wrong
		else if(impl.cached_t_start) {
			t_start = impl.cached_t_start;
		}
		else {
			BOOMR.addVar("rt.start", "none");
			t_start = undefined;			// force all timers to NaN state
		}

		BOOMR.debug("Got start time: " + t_start, "rt");
		impl.cached_t_start = t_start;

		return t_start;
	}
function ( ename , data ) { var t_start ; if ( ename === "xhr" ) { if ( data && data . name && impl . timers [ data . name ] ) { // For xhr timers, t_start is stored in impl.timers.xhr_{page group name} // and xhr.pg is set to {page group name} t_start = impl . timers [ data . name ] . start ; } else if ( data && data . timing && data . timing . requestStart ) { // For automatically instrumented xhr timers, we have detailed timing information t_start = data . timing . requestStart ; } BOOMR . addVar ( "rt.start" , "manual" ) ; } else if ( impl . navigationStart ) { t_start = impl . navigationStart ; } else if ( impl . t_start && impl . navigationType !== 2 ) { t_start = impl . t_start ; // 2 is TYPE_BACK_FORWARD but the constant may not be defined across browsers BOOMR . addVar ( "rt.start" , "cookie" ) ; // if the user hit the back button, referrer will match, and cookie will match } // but will have time of previous page start, so t_done will be wrong else if ( impl . cached_t_start ) { t_start = impl . cached_t_start ; } else { BOOMR . addVar ( "rt.start" , "none" ) ; t_start = undefined ; // force all timers to NaN state } BOOMR . debug ( "Got start time: " + t_start , "rt" ) ; impl . cached_t_start = t_start ; return t_start ; }
Determines the best value to use for t_start.
If called from an xhr call, then use the start time for that call
Else, If we have navigation timing, use that
Else, If we have a cookie time, and this isn't the result of a BACK button, use the cookie time
Else, if we have a cached timestamp from an earlier call, use that
Else, give up

@param ename	The event name that resulted in this call. Special consideration for "xhr"
@param data  Data passed in from the event caller. If the event name is "xhr",
this should contain the page group name for the xhr call in an attribute called `name`
and optionally, detailed timing information in a sub-object called `timing`
and resource information in a sub-object called `resource`

@returns the determined value of t_start or undefined if unknown
Determines the best value to use for t_start . If called from an xhr call then use the start time for that call Else If we have navigation timing use that Else If we have a cookie time and this isn t the result of a BACK button use the cookie time Else if we have a cached timestamp from an earlier call use that Else give up