Edit in JSFiddle

<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>     <script>
    $(document).ready(function(){
        var count = 5;//حدد مقدار الثواني من هنا
        
        var countt = count*1000;
        function bessah(){
       setTimeout(bessah,countt);

var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')'; 

           $('body').css("background",hue); 
           } 
            
           bessah(); 
    }); 
    </script>