rotate freely prefab

hii, i'm new to unity ,i want make a prefab cube which is freely rotate with custom speed. how can i do it.

is there any inbuild function in unity to rotate object.?

function Update()
{
transform.Rotate(0,0,0.1*Time.time); 

}