#include "exc_platform.h"

#ifdef KR_headers
extern float etime_(float *tarray);
#else
extern float etime_();
#endif

float
#ifdef KR_headers
dtime_(tarray) float *tarray;
#else
dtime_(float *tarray)
#endif
{
    static int isFirst = 1;
    static float oTime[2];
    float cTime[2];

    if (isFirst == 1) {
	float ret = etime_(oTime);
	isFirst = 0;
	tarray[0] = oTime[0];
	tarray[1] = oTime[1];
	return ret;
    }
    
    (void)etime_(cTime);
    tarray[0] = cTime[0] - oTime[0];
    tarray[1] = cTime[1] - oTime[1];
    oTime[0] = cTime[0];
    oTime[1] = cTime[1];

    return tarray[0] + tarray[1];
}

