|
|
ru.perl- RU.PERL ---------------------------------------------------------------------- From : Ilya Dikarev 2:5004/75.1313 23 Jun 2007 00:38:16 To : Vadim Tzirulnicov Subject : Re: Как узнать текущее время с точностью до миллисекунд ? -------------------------------------------------------------------------------- VT> Hужно узнать, сколько прошло миллисекунд с момента полечения данных А до VT> получения данных Б. Делаю это с точностью до секунд, в нужный момент VT> запрашивая текущее время через time(); А как получить его с точностью до VT> миллисекунд ? Хотя и не на перле, но, думаю, пригодится. NAME gettimeofday, settimeofday - get / set time SYNOPSIS #include <sys/time.h> int gettimeofday(struct timeval *tv, struct timezone *tz); int settimeofday(const struct timeval *tv , const struct timezone *tz); DESCRIPTION The functions gettimeofday and settimeofday can get and set the time as well as a timezone. The tv argument is a timeval struct, as specified in <sys/time.h>: struct timeval { time_t tv_sec; /* seconds */ suseconds_t tv_usec; /* microseconds */ }; and gives the number of seconds and microseconds since the Epoch (see time(2)). The tz argument is a timezone : struct timezone { int tz_minuteswest; /* minutes W of Greenwich */ int tz_dsttime; /* type of dst correction */ }; -- XMMS is in /*Silence*/ Auswendig Zeile 'make' Kennen Suse und Mandrake --- tin/1.4.6-20020816 ("Aerials") (UNIX) (Linux/2.6.16.18 (i686)) * Origin: '//Unix or dead..' (2:5004/75.1313) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.perl/4567d2abe297.html, оценка из 5, голосов 10
|