Using toggle to call a function continuously until toggled again

Using toggle to call a function continuously until toggled again

I have been trying to get a function to run continuously with with toggle function.  Here is the snippet of code: 

  1.  
  2. $('#infinite').toggle(function() {
  3.                         $(this).css({"color":"red"});
  4.                         infiniteloop();
  5.                 },
  6.                 function (){

  7.                         $(this).css({"color":"black"});
  8.                 }
  9.                 );

The above code should run after the first time the button is clicked, once it is clicked again the function should no longer run.  Any suggestions on how to get this working?  If toggle is the wrong function to use I'm open to suggestions.