(self)
return datetime.datetime.utcnow() - time_sent
Return timedelta since running start_timing

        Only the first call to stop_and_pop_timing will return a timedelta;
        subsequent calls will return None until the next time start_timing is called.

        This helps avoid double-recording timings (for example when a task is retried).
Return timedelta since running start_timing
Return timedelta since running start_timing
def stop_and_pop_timing(self):
        """
        Return timedelta since running start_timing

        Only the first call to stop_and_pop_timing will return a timedelta;
        subsequent calls will return None until the next time start_timing is called.

        This helps avoid double-recording timings (for example when a task is retried).
        """
        time_sent = cache.get(self._cache_key)
        if time_sent is None:
            raise TimingNotAvailable()

        cache.delete(self._cache_key)

        return datetime.datetime.utcnow() - time_sent
def stop_and_pop_timing ( self ) : time_sent = cache . get ( self . _cache_key ) if time_sent is None : raise TimingNotAvailable ( ) cache . delete ( self . _cache_key ) return datetime . datetime . utcnow ( ) - time_sent