Commit 0cc707ae authored by Deucе's avatar Deucе 👌🏾
Browse files

Use xp_timer()-based msclock() on Win32 too.

Now it should keep working after 24 days.
parent f3d18723
Pipeline #2711 failed with stage
in 4 minutes and 47 seconds
......@@ -690,10 +690,9 @@ char* os_cmdshell(void)
return(shell);
}
/****************************************************************/
/* Microsoft (DOS/Win32) real-time system clock implementation. */
/****************************************************************/
#ifdef __unix__
/********************************************************/
/* Stupid real-time system clock implementation. */
/********************************************************/
clock_t msclock(void)
{
long double t = roundl(xp_timer() * 1000);
......@@ -705,7 +704,6 @@ clock_t msclock(void)
return (clock_t)t;
}
#endif
/****************************************************************************/
/* Skips all white-space chars at beginning of 'str' */
......
......@@ -378,14 +378,8 @@ DLLEXPORT char* byte_count_to_str(int64_t bytes, char* str, size_t size);
DLLEXPORT char* byte_estimate_to_str(int64_t bytes, char* str, size_t size, ulong unit, int precision);
/* Microsoft (e.g. DOS/Win32) real-time system clock API (ticks since process started) */
typedef clock_t msclock_t;
#if defined(_WIN32) || defined(__OS2__)
#define MSCLOCKS_PER_SEC CLOCKS_PER_SEC /* e.g. 18.2 on DOS, 1000.0 on Win32 */
#define msclock() clock()
#else
#define MSCLOCKS_PER_SEC 1000
msclock_t msclock(void);
#endif
#define MSCLOCKS_PER_SEC 1000
msclock_t msclock(void);
DLLEXPORT BOOL check_pid(pid_t);
DLLEXPORT BOOL terminate_pid(pid_t);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment