In this code, I am displaying 3 buttons and if I click the start and stop button within 1 second, then it is not showing any effects : but if i do that multiple number of times then that should result in the increment which it is not.
i want it to show the miliseconds that have passed between the simultaneous start stop buttons also

javascript code:

        var secs=0;
        var mins=0;
        var timer;
        var start=0;
        var stop=0;
        function add(){
            secs++;
            if(secs==60)
            {
                mins++;
                secs=0;
            }
            if(mins==6)
            {
                mins=0;
                secs=0;
            }

            display();
        }

        function startc(){
            if(start==0)
            { 
                timer=setInterval(add,1000);
                start=1;
            }
        }

        function stopc(){
            clearInterval(timer);
            start=0;
            stop=1;
        }

        function clearc(){
            secs=0;
            mins=0;
            clearInterval(timer);
            display();
            if(stop!=1)
            {
                start=0;
                startc();
            }

        }