/* This Source Code Form is subject to the terms of the Mozilla Public *License,.0IfoftheMPLnotwiththis
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* *Programtotestdifferentwaystogetthetime;rightnowitistuned *onlyforsolaris. *solarisresults(100000iterations): *timetogettimewithtime():4.63usecavg,463msectotal *timetogettimewithgethrtime():2.17usecavg,217msectotal *timetogettimewithgettimeofday():1.25usecavg,125msectotal * *
*/ /*********************************************************************** **Includes
***********************************************************************/ /* Used to get the command line option */ #include"plgetopt.h"
d = (double)PR_IntervalToMicroseconds(stop - start);
tot = PR_IntervalToMilliseconds(stop - start);
if (debug_mode) {
printf("%40s: %6.2f usec avg, %d msec total\n", msg, d / count, tot);
}
}
int main(int argc, char** argv) { /* The command line argument: -d is used to determine if the test is being run indebugmode.Theregresstoolrequiresonlyonelineoutput:PASSorFAIL. Alloftheprintfsassociatedwiththistesthasbeenhandledwithaif (debug_mode)test.Usage:test_name-d
*/
PLOptStatus os;
PLOptState* opt = PL_CreateOptState(argc, argv, "d:"); while (PL_OPT_EOL != (os = PL_GetNextOpt(opt))) {
if (PL_OPT_BAD == os) { continue;
} switch (opt->option) { case'd': /* debug mode */
debug_mode = 1; break; default: break;
}
}
PL_DestroyOptState(opt);
Measure(timeTime, "time to get time with time()");
Measure(timeGethrtime, "time to get time with gethrtime()");
Measure(timeGettimeofday, "time to get time with gettimeofday()");
Measure(timePRTime32, "time to get time with PR_Time() (32bit)");
Measure(timePRTime64, "time to get time with PR_Time() (64bit)");
PR_Cleanup(); return0;
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.5Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.