Miliseconds capturing

Posted By: gamers

Miliseconds capturing - 01/24/23 07:54

Hi, 3DGS developers,

I can capture system time, minute and second information with 3DGS in real-time (i.e., sys_hours, sys_minutes, sys_seconds), but I want to get it in milliseconds as well. How can I do that?
Posted By: VoroneTZ

Re: Miliseconds capturing - 02/06/23 13:27

Hi
You need to use WINAPI functions
here what i'm found
(dont forget about SEARCH button!)
SOURCE

Code
#include <default.c>
#include <stdio.h>
#include <windows.h>

typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;


void main()
{
SYSTEMTIME st;

GetSystemTime(&st);

printf("The system time is: %02d:%02d:%02d:%02d",st.wHour, st.wMinute,st.wSecond, st.wMilliseconds);

}


Posted By: VoroneTZ

Re: Miliseconds capturing - 02/06/23 16:03

also you can check samples\reactiontest.c and dtimer function
Posted By: gamers

Re: Miliseconds capturing - 03/14/23 12:17

Thank you VoroneTZ laugh

Originally Posted by VoroneTZ
Hi
You need to use WINAPI functions
here what i'm found
(dont forget about SEARCH button!)
SOURCE

Code
#include <default.c>
#include <stdio.h>
#include <windows.h>

typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;


void main()
{
SYSTEMTIME st;

GetSystemTime(&st);

printf("The system time is: %02d:%02d:%02d:%02d",st.wHour, st.wMinute,st.wSecond, st.wMilliseconds);

}


© 2024 lite-C Forums