Skip to content

sysGetCurrentTime seems wrong #153

Open
@Fewnity

Description

@Fewnity

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions