checkspeed: use startclock instead of lastclock to ensure

Linux compatibility.
This commit is contained in:
Holger Vogt 2021-01-20 08:08:17 +01:00
parent 4d03883d78
commit deeee2950f
1 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ int fixme_inoise_type = SV_NOTYPE;
#define DOUBLE_PRECISION 15 #define DOUBLE_PRECISION 15
static clock_t lastclock, currclock; static clock_t lastclock, currclock, startclock;
static double *rowbuf; static double *rowbuf;
static size_t column, rowbuflen; static size_t column, rowbuflen;
@ -433,7 +433,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
sh_vecinit(run); sh_vecinit(run);
#endif #endif
lastclock = clock(); startclock = clock();
return (OK); return (OK);
} }
@ -547,7 +547,7 @@ OUTpD_memory(runDesc *run, IFvalue *refValue, IFvalue *valuePtr)
if (ft_ngdebug && d->type == IF_REAL && eq(d->name, "speedcheck")) { if (ft_ngdebug && d->type == IF_REAL && eq(d->name, "speedcheck")) {
/* current time */ /* current time */
clock_t cl = clock(); clock_t cl = clock();
double tt = ((double)cl - (double)lastclock) / CLOCKS_PER_SEC; double tt = ((double)cl - (double)startclock) / CLOCKS_PER_SEC;
plotAddRealValue(d, tt); plotAddRealValue(d, tt);
} }
else if (d->type == IF_REAL) else if (d->type == IF_REAL)