If you're looking to achieve this task, Alvin and Monkeyinsight both suggest using CSS or SVG markup. However, it seems like you prefer using Snap for your project. An alternative approach is to create an infinite animation in Snap with a callback function.
var s = Snap("#svg");
var block = s.rect(100, 100, 100, 100);
function infRotate( el ) {
el.transform('r0,150,150'); // Reset the transform property
el.animate({ transform: 'r360,150,150' }, 2000, mina.linear, infRotate.bind( null, el));
};
infRotate( block );
This callback function can be used for more complex animations. You can view a working example on jsfiddle.
While CSS/SVG solutions may be more efficient, using Snap offers flexibility for other functionalities. Just a reminder to monitor memory usage if the animation runs for an extended period of time.