Measure the input time

Hey, Could you help me about that, how can I measure and write the time to the console, that the user spent of writing into the input.

1
2
3
4
5
6
7
8
  int N;
	cout << "Give me the number of people: ";
	cin >> N;
	while (N < 3 || N > 15)
	{
		cout << "Number from 3 to 15. Give me again:: ";
		cin >> N;
	}
You can include ctime library and use the difftime() function by providing it two times. one returned before going for input and one immediately after input using time() function which returns current time.
For further info on time library see :
http://www.cplusplus.com/reference/ctime/
Last edited on
Topic archived. No new replies allowed.