есть функция getimeofday (). возвращает время в ms, здесь: http://souptonuts.sourceforge.net/code/gettimeofday.c.html