Edit in JSFiddle

( function () {

	var TIME = 5000;//<--- 5 secs
  var CHECK = 100;
	var SPEED = 100;
  
	var isHidden = false;

  var mousePos = { x:0, y:0 };
  var mousePosSave = { x:0, y:0 };
  var mouseCheckInterval;
  var mouseCheckTimeout;
  
  function init() {

    mouseCheckInterval = setInterval( checkMousePosition, CHECK );

  };

  function checkMousePosition() {

    if ( mousePos.x === mousePosSave.x && mousePos.y === mousePosSave.y ) {

      hideElement();

    }

    mousePosSave.x = mousePos.x;
    mousePosSave.y = mousePos.y;

  };

  function showElement() {

    if ( isHidden ) {

      $( document ).find( '#content' ).show( SPEED );

      isHidden = false;

    }

  };

  function hideElement() {

    if ( !isHidden ) {

      mouseCheckTimeout = setTimeout( function() { $( document ).find( '#content' ).hide( SPEED ); }, TIME );

      isHidden = true;

    }

  };

  $( window ).mousemove( function( event ) {

    clearTimeout( mouseCheckTimeout );

    showElement();

    mousePos = getMousePos( event );

  } );

  function getMousePos( event ) {

    return { x:event.pageX, y:event.pageY };

  };

  init();

} )();
<p id="content">
Hello world!
</p>