Look at all the functions and your can work it out.
But I did it for you anyway…
You can make it a class so it can be used easier, but this should give you the idea.
Code:
#include <iostream>
#include <ctime>
#include <string>
using namespace std;
int main ()
{
clock_t start;
clock_t end;
double total;
string garbage;
cout << "Type in the word 'Switzerland': ";
start = clock();
cin >> garbage;
end = clock();
total = end-start;
cout << "It took you " << total << " ticks which in\n";
cout << "seconds is : " << total/CLOCKS_PER_SEC;
return 0;
}