This is driving me crazy. I have a code which is outputting a weird value while using division:
#define NANOSECONDS_PER_SECOND 1000000000
uint64 CurrentTimeInNanoSecs;
uint64 GetTimeInNanoSecs( )
{
printf("\n%X", (CurrentTimeInNanoSecs >> 32) );
printf("\n%X", (CurrentTimeInNanoSecs & 0xFFFFFFFF) );
return ( CurrentTimeInNanoSecs );
}
void GetCurrentTimeInSecs()
{
uint32 Time = GetTimeInNanoSecs() / NANOSECONDS_PER_SECOND;
printf("%X", time);
}
void main()
{
GetCurrentTimeInSecs();
}
On init, I see the prints as follows: 0x00000000 0x3016DC6B 0x00000198
I am not sure what is happening. Can someone pls help.