Simple mesh animation

Is there anyway to get a mesh to spin with out having to make it then import it?

Perhaps with a script?

function Update() {
transform.rotate(Vector3.forward, Time.deltaTime);
}

Will rotate the object about its local z-axis by 1°/sec.