#include "PmbCxxUtils/CustomBenchmark.h"
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cmath>
Go to the source code of this file.
◆ main()
int main |
( |
int |
, |
|
|
char ** |
|
|
) |
| |
Definition at line 15 of file custombenchmark_example.cxx.
18 const unsigned maxpdgrecord=99;
22 for (
unsigned i=0;
i<100;++
i) {
23 int pdg = -150+(
rand()%30)*10;
24 int id = std::min<unsigned>(maxpdgrecord,abs(pdg));
27 for (
unsigned j=0;j<3000*(abs(pdg)+1);++j)
34 for (
unsigned i=0;
i<100;++
i) {
35 int pdg = -150+(
rand()%30)*10;
36 int id = std::min<unsigned>(maxpdgrecord,abs(pdg));
40 for (
unsigned j=0;j<3000*(abs(pdg)+1);++j)
48 for (
unsigned pdg = 0; pdg<=maxpdgrecord; ++pdg) {
50 bench.getData(pdg,
count, time_ms);
52 std::cout<<
"Work done on particle with |pdg|="<<pdg<<(pdg==maxpdgrecord?
"+":
"")
53 <<
" was done "<<
count<<
" times and took a total of "<<time_ms
54 <<
" milliseconds [on average "<<time_ms/
count<<
" ms each time]"<<std::endl;