Stephan Ferraro <step...@ferraro.net> wrote: > time() = 1281441644 > time() = 1281441644 > > If I understand it correctly the call of time() is a system call and requires > each time context switching etc...
If you have an old program that still calls time().... but anyway, a time() call only takes aprox. 200ns. > Would it be not faster (for the performance) that every libc linked program > opens only once at startup a device like /dev/time (which does not exists on > opensolaris) and uses mmap on it? Bad idea if you like to have nanosecond granularity. With current clock granularity, you need to run computations to correct the time. How do you like to do this in mmap()ed locations? Any resolution above the tickrate of the kernel cannot be implemented efficiently and correct at the same time. If you use e.g. gettimeofday() that maps to a "fast syscall" that cannot be seen by truss. Calls like gettimeofday() and gethrtime() take aprox. 300ns, but deliver microseconds or nanoseconds. Jörg -- EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin j...@cs.tu-berlin.de (uni) joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code