var LagStats = function () {
	var container = document.createElement('div');
	container.id = 'lag-stats';
	container.style.cssText = 'width:80px;opacity:0.9';

	var msDiv = document.createElement('div');
	msDiv.style.cssText = 'padding:0 0 3px 3px;text-align:left;background-color:#020';
	container.appendChild(msDiv);

	var msText = document.createElement('div');
	msText.style.cssText = 'color:#0f0;font-size:9px;line-height:15px';
	msText.innerHTML = 'MS lag';
	msDiv.appendChild(msText);

	var msGraph = document.createElement('div');
	msGraph.style.cssText = 'position:relative;width:74px;height:30px;background-color:#0f0';
	msDiv.appendChild(msGraph);

	while (msGraph.children.length < 74) {
		var bar = document.createElement('span');
		bar.style.cssText = 'width:1px;height:30px;float:left;background-color:#131';
		msGraph.appendChild(bar);
	}

	var updateGraph = function (elm, value) {
		var child = elm.appendChild(elm.firstChild);
		child.style.height = value + 'px';
	}

	function formatMS(ms) {
		var str = ms.toFixed(2);
		while (str.length < 6) str = '&nbsp;' + str;
		return str;
	}

	return {
		domElement: container,
		addDataPoint: function (ms) {
			msText.innerHTML = formatMS(ms) + 'ms lag';
			updateGraph(msGraph, Math.min(1, 1 - ms/200)*30);
		},
	}
};

@@ -424,16 +424,33 @@
 ght:15px
+;white-space:pre;
 ';%0A%09msTe
@@ -1018,24 +1018,101 @@
 matMS(ms) %7B%0A
+%09%09var suffix = 'ms';%0A%09%09if (ms %3E 1000) %7B%0A%09%09%09ms /= 1000;%0A%09%09%09suffix = 's ';%0A%09%09%7D%0A
 %09%09var str = 
@@ -1162,14 +1162,9 @@
  = '
-&nbsp;
+ 
 ' + 
@@ -1180,16 +1180,25 @@
 turn str
+ + suffix
 ;%0A%09%7D%0A%0A%09r
@@ -1277,20 +1277,20 @@
 xt.inner
-HTML
+Text
  = forma
@@ -1300,18 +1300,16 @@
 (ms) + '
-ms
  lag';%0A%09

Handle seconds of lag.