Example program to test JEEP::JTimekeeper class.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include "Jeep/JTimekeeper.hh"
#include "JSystem/JTime.hh"
#include "Jeep/JPrint.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
Example program to test JEEP::JTimekeeper class.
- Author
- mdejong
Definition in file JTimekeeper.cc.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 18 of file JTimekeeper.cc.
36 catch(
const exception &error) {
37 FATAL(error.what() << endl);
43 if (intervalTime_ms <= 0) {
FATAL(
"interval time [ms] " << intervalTime_ms <<
" < 0." << endl); }
44 if (totalTime_s <= 0) {
FATAL(
"total time [s] " << totalTime_s <<
" < 0." << endl); }
46 JFileDescriptorMask mask;
48 cout <<
"hit <return> to interrupt" << endl;
52 clock.setInterval(intervalTime_ms * 1000);
58 int numberOfInterrupts = 0;
60 for (
int i = 0; i < 1000 * totalTime_s / intervalTime_ms; ) {
64 mask.set(STDIN_FILENO);
66 if (clock.wait(mask)) {
81 NOTICE(
"Number of interrupts " << setw(8) << right << numberOfInterrupts << endl);
82 NOTICE(
"Total delay [ms] " << setw(8) << right << clock.getDelay() / 1000 << endl);
83 NOTICE(
"Elapsed time [ms] " << setw(8) << right << (t1 - t0) / 1000 << endl);
85 if (numberOfInterrupts != 0) {
86 NOTICE(
"Time per interrupt [us] " << setw(8) << right << (t1 - t0 - clock.getDelay()) / numberOfInterrupts << endl);
Utility class to parse command line options.
std::ostream & rewind(std::ostream &out)
Rewind character.
static const JLocalTime getLocalTime
Function object to get local time in micro seconds.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
then usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG