title: Python cmd timer creation
body: <p>I have the following code:</p>
  
  <pre><code>class OCP(cmd.Cmd):
      intro = 'Welcome to the  OCP shell.   Type help or ? to list commands.\n'
      prompt = '&gt; '
      file = None
  
      def do_connect(self, arg):
          'connect'
  
          logging.debug('&gt; connect')
          connect()
  </code></pre>
  
  <p>I have this code that uses cmd from python. What I want is to run a timer everytime the user enters connect for 30 secs.
  If after the 30 secs the user still didn't type anything, it prints a "disconnected" state.</p>
  
  <p>How should I do this?</p>