# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2023 all rights reserved
#


# externals
import time
# base class
from .Timer import Timer


# a timer that measure elapsed wall clock time
class WallTimer(Timer):
    """
    Use a monotonic wall clock to provide timing info
    """


    # interface
    def sec(self):
        """
        Convert the elapsed time into seconds
        """
        # my clock uses seconds internally
        return self.read()


    def ms(self):
        """
        Convert the elapsed time into milliseconds
        """
        # my clock uses seconds internally
        return 1000 * self.read()


    def us(self):
        """
        Convert the elapsed time into microseconds
        """
        return 1000 * 1000 * self.read()


    # implementation details
    def clock(self):
        """
        Generate a time stamp
        """
        # use the monotonic system clock to get a time stamp
        return time.clock_gettime(time.CLOCK_MONOTONIC)


# end of file

ccc5a801009412f0e2bd18c48bdf13aa2a688016
<mask token>


class WallTimer(Timer):
    <mask token>

    def sec(self):
        """
        Convert the elapsed time into seconds
        """
        return self.read()
    <mask token>

    def us(self):
        """
        Convert the elapsed time into microseconds
        """
        return 1000 * 1000 * self.read()

    def clock(self):
        """
        Generate a time stamp
        """
        return time.clock_gettime(time.CLOCK_MONOTONIC)

<mask token>


class WallTimer(Timer):
    <mask token>

    def sec(self):
        """
        Convert the elapsed time into seconds
        """
        return self.read()

    def ms(self):
        """
        Convert the elapsed time into milliseconds
        """
        return 1000 * self.read()

    def us(self):
        """
        Convert the elapsed time into microseconds
        """
        return 1000 * 1000 * self.read()

    def clock(self):
        """
        Generate a time stamp
        """
        return time.clock_gettime(time.CLOCK_MONOTONIC)

<mask token>


class WallTimer(Timer):
    """
    Use a monotonic wall clock to provide timing info
    """

    def sec(self):
        """
        Convert the elapsed time into seconds
        """
        return self.read()

    def ms(self):
        """
        Convert the elapsed time into milliseconds
        """
        return 1000 * self.read()

    def us(self):
        """
        Convert the elapsed time into microseconds
        """
        return 1000 * 1000 * self.read()

    def clock(self):
        """
        Generate a time stamp
        """
        return time.clock_gettime(time.CLOCK_MONOTONIC)

import time
from .Timer import Timer


class WallTimer(Timer):
    """
    Use a monotonic wall clock to provide timing info
    """

    def sec(self):
        """
        Convert the elapsed time into seconds
        """
        return self.read()

    def ms(self):
        """
        Convert the elapsed time into milliseconds
        """
        return 1000 * self.read()

    def us(self):
        """
        Convert the elapsed time into microseconds
        """
        return 1000 * 1000 * self.read()

    def clock(self):
        """
        Generate a time stamp
        """
        return time.clock_gettime(time.CLOCK_MONOTONIC)

# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2023 all rights reserved
#


# externals
import time
# base class
from .Timer import Timer


# a timer that measure elapsed wall clock time
class WallTimer(Timer):
    """
    Use a monotonic wall clock to provide timing info
    """


    # interface
    def sec(self):
        """
        Convert the elapsed time into seconds
        """
        # my clock uses seconds internally
        return self.read()


    def ms(self):
        """
        Convert the elapsed time into milliseconds
        """
        # my clock uses seconds internally
        return 1000 * self.read()


    def us(self):
        """
        Convert the elapsed time into microseconds
        """
        return 1000 * 1000 * self.read()


    # implementation details
    def clock(self):
        """
        Generate a time stamp
        """
        # use the monotonic system clock to get a time stamp
        return time.clock_gettime(time.CLOCK_MONOTONIC)


# end of file
