Skip to content
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

sysGetCurrentTime seems wrong #153

Open
Fewnity opened this issue Jan 3, 2025 · 0 comments
Open

sysGetCurrentTime seems wrong #153

Fewnity opened this issue Jan 3, 2025 · 0 comments

Comments

@Fewnity
Copy link

Fewnity commented Jan 3, 2025

I was trying to measure time to check my code execution time, I saw these functions:
sysGetCurrentTime, sysGetSystemTime, __gettime and std::chrono::high_resolution_clock::now(), I tried them all and I don't understand sysGetCurrentTime. (Other function works great)

Here is a test code:

uint64_t sec = 0;
uint64_t nsecStart = 0;
uint64_t nsecEnd = 0;
sysGetCurrentTime(&sec , &nsecStart);
sysSleep(1); // Wait 1 sec
sysGetCurrentTime(&sec , &nsecEnd);

nsec values seems wrong, nsecStart = 942584962 and nsecEnd = 972889799
972889799 - 942584962 = 30304837

Is this function broken? I tried to see the implementation in the cell sdk and to recode it and I still have weird values.
I tried to use the value from sysGetTimebaseFrequency and make something with it but I can't. Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant