// Example use of the time() function:
#include <iostream>
#include <cstdlib>
#include <ctime>

int main ()
{

  double sum=0.0;

  time_t t0 = time (NULL);
  std::cout << t0/(3600*24) << " days have past since 01/01/1970\n";

  std::cout << "This will just take a minute or so ...\n";
  for (long i=1; i<=1e10L; i++) sum += rand()/(RAND_MAX+1.0);
  std::cout << "mean = " << sum/1e10L << std::endl;

  time_t t1 = time (NULL);
  std::cout << "That took " << t1-t0 << " seconds.\n";

  return 0;
}
