<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rehighlight(self):
 """ Rehighlight the entire document, may be slow. """

        start = time.time()
        QtWidgets.QApplication.setOverrideCursor(
            QtGui.QCursor(QtCore.Qt.WaitCursor))
        try:
            super(SyntaxHighlighter, self).rehighlight()
        except RuntimeError:
            # cloned widget, no need to rehighlight the same document twice ;)
            pass
        QtWidgets.QApplication.restoreOverrideCursor()
        end = time.time()
        _logger().debug('rehighlight duration: %fs' % (end - start))