Regarding 1 tick in windows and posix

I see C ++ code under windows.

Indicates that 1 tick equals 100 nanoseconds. Does it depend on the windows? or Is it some kind of general standard if that is what is called a standard? The same thing on other OS?

Reason for requesting the above question. I have to write platform-independent code, if it depends on Windows, I have to add #ifdef WIN32 for this piece of code.

+5
source share
2 answers

This is the specification for Microsoft: see here

The smallest unit of time is a check mark, which is equal to 100 nanoseconds. A check mark can be negative or positive.

Linux , 100 , .

+1

Microsoft, Windows. (, UNIX- POSIX- ) , , .. , struct timeval ( ) :

struct timeval {
    __darwin_time_t         tv_sec;    /* seconds */
    __darwin_suseconds_t    tv_usec;   /* and microseconds */
};
0

All Articles