ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/Utils/src/Benchmark.cc
Revision: 1.1
Committed: Fri Oct 9 19:56:45 2009 UTC (15 years, 6 months ago) by kukartse
Content type: text/plain
Branch: MAIN
CVS Tags: V00-00-02, V00-00-01_BeamSplash09, gak110409, HEAD
Log Message:
*** empty log message ***

File Contents

# Content
1 // -*- C++ -*-
2 //
3 // Package: Benchmark
4 // Class: Benchmark
5 //
6 /**\class Benchmark Benchmark.h LJMet/Utils/interface/Benchmark.h
7
8 Description: times various aspects of data processing
9
10 Implementation:
11 Keep this class as simple and fast as possible
12 */
13 //
14 // Original Author: "Gennadiy Kukartsev"
15 // Created: Tue Oct 6 13:39:12 CDT 2009
16 // $Id: Benchmark.cc,v 1.1 2009/10/08 22:51:48 kukartse Exp $
17 //
18 //
19
20 #include "LJMet/Utils/interface/Benchmark.h"
21
22 Benchmark::Benchmark(const edm::ParameterSet& iConfig){
23 counter = new MeanCounter("Benchmark");
24 counter->chime("Benchmark: constructor: ");
25 }
26
27
28 Benchmark::~Benchmark()
29 {
30 counter->chime("Benchmark: destructor, counter is about to be deleted: ");
31 delete counter;
32 }
33
34
35 void
36 Benchmark::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
37 {
38 counter->count();
39 cout << "CLOCK: " << counter->get_times() << endl;
40 cout << "CLOCK diff: " << counter->get_times_diff() << endl;
41 counter->set_times_mark();
42 counter->end_clock("end_clock: ");
43 counter->start_clock();
44 }
45
46
47 void
48 Benchmark::beginJob()
49 {
50 counter->chime("Benchmark: beginJob(): ");
51 counter->set_times_mark();
52 }
53
54
55 void
56 Benchmark::endJob() {
57 counter->chime("Benchmark: endJob(): ");
58 }
59
60 //define this as a plug-in
61 DEFINE_FWK_MODULE(Benchmark);