Is there a elegant way to calculate the difference in minutes between two bars/dates?

I am doing this at the moment:
Code:
#include <profile.c>
 
static int start;
function run()
{
	
	
	BarPeriod = 60;
	LookBack  = 1; 
	UnstablePeriod=0;
	 
	StartDate = 20150101;
	EndDate   = 20150102;
	static double atr ;
 
  int bp =  (BarPeriod)/TimeFrame;
 if (Bar==2)
 	start = Bar;
 if (Bar >6)
 		print(TO_WINDOW, "\nBar %d Start =  %d - diff in min %d",Bar, start, (Bar-start)*bp );
 	
 
}