-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Remove GetSystemTime/GetSystemTimeAsFileTime from PAL #119543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
{ | ||
STATIC_CONTRACT_NOTHROW; | ||
|
||
#ifdef HOST_WINDOWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicating the code from aot EventPipe. They are the only users of system time now and wrapping through minipal can introduce unnecessary complexity. Maybe we can share code among EventPipe implementations as many functions are moving to minipal?
CRITSEC_COOKIE lock; // lock | ||
uint64_t tickFrequency; // number of ticks per second | ||
uint64_t startTimeStamp; // start time from when tick counter started | ||
FILETIME startTime; // time the application started |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This field is specified in StressLog cdac, but not used. Is it fine to change it? The bit order of FILETIME should be the same with int64 on LE.
#ifndef TARGET_UNIX | ||
GetLocalTime(&st); | ||
struct timespec ts; | ||
int ret = timespec_get(&ts, TIME_UTC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is debug only. This should be the simplest code that works cross platform.
Co-authored-by: Michał Petryka <[email protected]>
No description provided.