Hola:
<html>
<head>
<script type="text/javascript">
var t = 0;
retardo = 100;
function cargando() {
document.getElementById("porciento").style.width = ++t + "%";
if (t < 100) setTimeout("cargando()", retardo);
}
</script>
</head>
<body onload="cargando()">
<div style="width: 200px; height: 20px; border: 1px solid gray" >
<div id="porciento" style="width: 0%; height: 100%; background-color: pink" ></div>
</div>
</body>
</html>
Saludos