<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<script>
var element;
PerfTestRunner.measureTime({
description: "Measures performance of changing a DOM element's className property.",
setup: function() {
element = document.createElement('div');
},
run: function() {
for (var i = 0; i < 500000; ++i) {
element.className = 'class1';
element.className = 'class2';
}
}
});
</script>
</body>
</html>