ďťż

Ładny brzuch

W jaki sposób pod C++ Builderm w Windowsie2000/XP, uzyskać czas działania procesu... Prosiłbym o kod...



piepik czy mysmy juz nie omawiali tego tematu? ;)void __fastcall TForm1::Timer1Timer(TObject *Sender) {   FILETIME CreationTime;   FILETIME ExitTime;   FILETIME KernelTime;   FILETIME UserTime;   HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION , FALSE, GetCurrentProcessId() );   if ( GetProcessTimes(hProcess, &CreationTime, &ExitTime, &KernelTime, &UserTime) ) {      SYSTEMTIME runTimeS, currentTimeS;      FILETIME currentTimeF, runTimeF;      GetSystemTime(¤tTimeS);      SystemTimeToFileTime(¤tTimeS, ¤tTimeF);      __int64 runTime = ( ((__int64)currentTimeF.dwHighDateTime<<32)+(__int64)currentTimeF.dwLowDateTime ) -                        ( ((__int64)CreationTime.dwHighDateTime<<32)+(__int64)CreationTime.dwLowDateTime );      runTimeF.dwHighDateTime = runTime>>32;      runTimeF.dwLowDateTime = runTime;      FileTimeToSystemTime(&runTimeF, &runTimeS);      Label1->Caption = String(runTimeS.wHour)+":"+String(runTimeS.wMinute)+":"+String(runTimeS.wSecond) +"."+String(runTimeS.wMilliseconds);   } }Mam nadzieje ze zasluzylem sobie juz na honorowe miejsce w hall of fame twojego progsa :]

pozdrawiam
pepsi^no1

Wielki dzięki...

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • zsf.htw.pl
  •