def toc(self, verbose=True, digits=2):
        """
        Return and print time elapsed since last `tic()`.

        Parameters
        ----------
        verbose : bool, optional(default=True)
            If True, then prints time.

        digits : scalar(int), optional(default=2)
            Number of digits printed for time elapsed.

        Returns
        -------
        elapsed : scalar(float)
            Time elapsed since last `tic()`.

        """
        if self.start is None:
            raise Exception("toc() without tic()")

        t = time.time()
        self.last = t
        elapsed = t-self.start

        if verbose:
            m, s = divmod(elapsed, 60)
            h, m = divmod(m, 60)
            print("TOC: Elapsed: %d:%02d:%0d.%0*d" %
                  (h, m, s, digits, (s % 1)*(10**digits)))

        return elapsed
def toc ( self , verbose = True , digits = 2 ) : if self . start is None : raise Exception ( "toc() without tic()" ) t = time . time ( ) self . last = t elapsed = t - self . start if verbose : m , s = divmod ( elapsed , 60 ) h , m = divmod ( m , 60 ) print ( "TOC: Elapsed: %d:%02d:%0d.%0*d" % ( h , m , s , digits , ( s % 1 ) * ( 10 ** digits ) ) ) return elapsed
Return and print time elapsed since last `tic()`.

        Parameters
        ----------
        verbose : bool, optional(default=True)
            If True, then prints time.

        digits : scalar(int), optional(default=2)
            Number of digits printed for time elapsed.

        Returns
        -------
        elapsed : scalar(float)
            Time elapsed since last `tic()`.