3 \brief
\83^
\83C
\83\80\83X
\83^
\83\93\83v
\8eæ
\93¾
\8aÖ
\90\94
5 \author Satofumi KAMIMURA
7 $Id: ticks.c 1305 2009-09-16 05:40:53Z satofumi $
11 #include "detect_os.h"
12 #if defined WINDOWS_OS
22 int current_ticks = 0;
25 // Linux
\82Å SDL
\82ª
\82È
\82¢
\8fê
\8d\87\82Ì
\8eÀ
\91\95\81B
\8dÅ
\8f\89\82Ì
\8cÄ
\82Ñ
\8fo
\82µ
\82Í 0
\82ð
\95Ô
\82·
26 static int first_ticks = 0;
28 gettimeofday(&tvp, NULL);
29 int global_ticks = tvp.tv_sec * 1000 + tvp.tv_usec / 1000;
30 if (first_ticks == 0) {
31 first_ticks = global_ticks;
33 current_ticks = global_ticks - first_ticks;
36 current_ticks = (int)(clock() / (CLOCKS_PER_SEC / 1000.0));