Merge pull request #9956 from Microsoft/bind-window-performance-now

In ts.performance.now, bind window.performance.now
This commit is contained in:
Nathan Shively-Sanders 2016-07-26 11:31:54 -07:00 committed by GitHub
commit 670f0c91b3

View File

@ -2,7 +2,7 @@
namespace ts {
declare const performance: { now?(): number } | undefined;
/** Gets a timestamp with (at least) ms resolution */
export const timestamp = typeof performance !== "undefined" && performance.now ? performance.now : Date.now ? Date.now : () => +(new Date());
export const timestamp = typeof performance !== "undefined" && performance.now ? () => performance.now() : Date.now ? Date.now : () => +(new Date());
}
/*@internal*/
@ -106,4 +106,4 @@ namespace ts.performance {
measures = undefined;
profilerEvent = undefined;
}
}
}