Skip to content

Conversation

huoyaoyuan
Copy link
Member

No description provided.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Sep 10, 2025
{
STATIC_CONTRACT_NOTHROW;

#ifdef HOST_WINDOWS
Copy link
Member Author

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
Copy link
Member Author

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);
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-PAL-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants