title: How to implement timeout for getline()?
body: <p>I want to read a string from command line through <code>getline()</code> in c++. </p>
  
  <p>For that I want to add a timer of <code>5</code> sec. If no string read, then the program will terminate. </p>
  
  <p>How can I do this?</p>