Storing elapsed time in an array then find min, max, average and standard dev

#include <iostream>
#include <stack>
#include <ctime>

std::stack<clock_t> tictoc_stack;

void tic() {
tictoc_stack.push(clock());
}

void toc() {
std::cout << "Time elapsed: "
<< ((double)(clock() - tictoc_stack.top())) / CLOCKS_PER_SEC
<< std::endl;
tictoc_stack.pop();

dif=(clock() - tictoc_stack.top())

}

int main

{
tic();

for (k=0;k<10;k++)

{



doSomething();

toc();

double t[10];

for(i=0;i<10;i++)

{

t[i]=dif;

std::cout<< "array is" << dif << std::endl;

}
}
return 0;
}

What I am trying to do is to run my program 10 times and check the elapsed time for each
iteration then save each elapsed time value in an array. Once I get them in there, I want to find the max, min, average and standard deviation. Can Somebody help me figure that out.
Topic archived. No new replies allowed.