Ejemplo n.º 1
0
static void initAuxmrWait() {
    epicsTimeStamp stime,etime;
    double elapsedTime = 0.0;
    int ntimes = 1;
    static int nloops = 1000000;
    double totalLoops;

    while(elapsedTime<1.0) {
        int i;
        ntimes *= 2;
        epicsTimeGetCurrent(&stime);
        for(i=0; i<ntimes; i++) wasteTime(nloops);
        epicsTimeGetCurrent(&etime);
        elapsedTime = epicsTimeDiffInSeconds(&etime,&stime);
    }
    totalLoops = ((double)ntimes) * ((double)nloops);
    nloopsPerMicrosecond = (totalLoops/elapsedTime)/1e6 + .99;
    if(ni1014Debug) {
        printf("totalLoops %f elapsedTime %f nloopsPerMicrosecond %ld\n",
             totalLoops,elapsedTime,nloopsPerMicrosecond);
        epicsTimeGetCurrent(&stime);
        microSecondDelay(1000000);
        epicsTimeGetCurrent(&etime);
        elapsedTime = epicsTimeDiffInSeconds(&etime,&stime);
        printf("elapsedTime %f\n",elapsedTime);
    }
}
Ejemplo n.º 2
0
void wasteTime(const std::chrono::time_point<TickClock, Duration> timePoint)
{
	wasteTime(std::chrono::time_point_cast<TickClock::duration>(timePoint));
}
Ejemplo n.º 3
0
void wasteTime(const std::chrono::duration<Rep, Period> duration)
{
	wasteTime(std::chrono::duration_cast<TickClock::duration>(duration));
}