From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199604041500.JAA23051@Bayou.UH.EDU> Date: Thu, 4 Apr 1996 09:00:25 -0600 (CST) From: yxc02740@Bayou.UH.EDU Subject: Help: lib function localtime extremely slow Hi, guess how long does the function localtime need to run? I tried a program as following: #include #include main() { struct timeval tv; struct timezone zone; struct tm *localclock; clock_t t0, t1; gettimeofday(&tv, &zone); t0 = clock(); localclock = localtime( (time_t *)&tv.tv_sec ); t1 = clock(); printf("time: %.3f\n", (float)(t1-t0)/CLOCKS_PER_SEC); } I found once that localtime takes about 28 seconds CPU time to run on a 166MHz UDB running redhat Linux. What on earth does the localtime do? sometimes it runs fast, but the time needed is about between 1-30 seconds. yansong