c++ - Programmatically compute the start time of a process on Windows -


I'm writing c / c ++ code on Windows using Visual Studio. I want to know that How to calculate the initial time effectively Can I just use gettimeofday ()? I've got the following code from Google, but I do not know what it's really doing:

  int gettimeofday (struct time time * TV, structure timezone * tz) {FILETIME ft ; Unsigned __int64 tmpres = 0; Fixed int ties flag; If (Nal! = TV) {GetSystemTimeAsFileTime (& amp; amp; ft); // I'm lost at this point tmpres | = Ft.dwHighDateTime; Tmpres & lt; & Lt; = 32; Tmpres | = Ft.dwLowDateTime; / * Convert file time to Unix era * / tmpres / = 10; / * Change to Microsoft * / tmpres - = DELTA_EPOCH_IN_MICROSECS; TV- & gt; TV_SC = (tall) (TMPRS / 1000000UL); Tv-> gt_usec = (long) (tmpres% 1000000UL); } If (zero! = Tees) {if (! Tzflag) {_tzset (); Tzflag ++; } Tz-> Tz_minuteswest = _timezone / 60; Tz- & gt; Tz_dsttime = _daylight; } Return 0; }  

If I think you are right then you want to know what time your process Started, right? So you want to see in GetProcessTimes ().

If you are interested then this process is the current process, you can use GetCurrentProcess () to get the process handle which you will need to call GetProcessTimes (); It gives a pseudo-handle that you do not need to stop.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -