function getInterval added to class.