startTime
Summary
Returns a DOMHighResTimeStamp with the mark’s High Resolution Time time value.
Property of apis/user_timing/PerformanceMarkapis/user_timing/PerformanceMark
Syntax
var result = element.startTime;
element.startTime = value;
Return Value
Returns an object of type
DOMHighResTimeStamp
Examples
// set begin mark
performance.mark("startMark");
// execute a function to be measured
someFunction();
// set end mark
performance.mark("stopMark");
// save the timing information
performance.measure("functionTime", "startMark", "stopMark");
// display the first mark's data
var marks = performance.getEntriesByType("mark");
alert("Mark name: " + marks[0].name + "\n" +
"Mark type: " + marks[0].entryType + "\n" +
"Mark start: " + marks[0].startTime + "\n" +
"Mark duration: " + marks[0].duration);
// clear the measure "functionTime"
performance.clearMeasures("functionTime");
// clear all marks
performance.clearMarks();
Related specifications
- W3C User Timing Specification
- W3C Recommendation
Attributions
Microsoft Developer Network: Windows Internet Explorer API reference Article