File: timming.c

package info (click to toggle)
xshipwars 1.32-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 17,176 kB
  • ctags: 6,357
  • sloc: ansic: 157,152; makefile: 226; sh: 75
file content (16 lines) | stat: -rw-r--r-- 284 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <sys/time.h>
#include <unistd.h>


/*
 *	returns the number of milliseconds since midnight.
 */
long MilliTime(void)
{
	static struct timeval tv[1];

	if(gettimeofday(tv, NULL) < 0)
            return(-1);

        return((tv->tv_sec % 86400) * 1000 + tv->tv_usec / 1000);
}