16 void Task::SetLogFile(TString name) { fOutName = name; }
19 if (fOutName.Length() > 0) {
21 fOutLog.open(fOutName);
23 gSystem->GetProcInfo(&fProcInfo);
24 fPrevTime = fProcInfo.fCpuUser;
26 if (fModulo < 0) fModulo = 1;
27 return Task::EInitFlag::kSUCCESS;
30 void Task::Exec(Option_t* ) {
31 if (fCounter % fModulo == 0) {
32 gSystem->GetProcInfo(&fProcInfo);
33 Double_t RamKB = fProcInfo.fMemResident;
34 Double_t dTime = fProcInfo.fCpuUser - fPrevTime;
35 fPrevTime = fProcInfo.fCpuUser;
36 TString info = Form(
"Event %8d Res Mem: %5d(MB) DUserCPU: %3.4f(s)", fCounter,
int(RamKB / 1000.0), dTime);
38 fOutLog << info << std::endl;
40 std::cout << info << std::endl;
49 fOutLog <<
"Timer report" << std::endl;
50 fOutLog <<
"CPU TIME: " << fTimer.CpuTime() << std::endl;
51 fOutLog <<
"Events processed: " << fCounter << std::endl;
54 std::cout <<
"Timer report" << std::endl;
55 std::cout <<
"CPU TIME: " << fTimer.CpuTime() << std::endl;
56 std::cout <<
"Events processed: " << fCounter << std::endl;
virtual void FinishTask()