#include "cyccounter.h" #include #include using namespace std; int main(int argc, char* argv[]){ if(argc != 3){ cerr << "Usage: " << argv[0] << " iterations frequency" << endl; return 1; } istringstream nstream(argv[1]), fstream(argv[2]); int n, f; nstream >> n; fstream >> f; int count = 0; cycles start = read_cyccounter(); for(int i = 0; i < n; i++){ if(i%f){ count += f; } } cycles end = read_cyccounter(); cout << count << " " << end-start << endl; return 0; }