lasdi.timing ============ .. py:module:: lasdi.timing .. autoapi-nested-parse:: .. _NumPy docstring standard: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard Classes ------- .. autoapisummary:: lasdi.timing.Timer Module Contents --------------- .. py:class:: Timer A light-weight timer class. .. py:attribute:: names Dictionary that maps job names to job indices. :type: :obj:`dict(str:int)` .. py:attribute:: calls :value: [] List that stores the number of calls for each job. :type: :obj:`list(int)` .. py:attribute:: times :value: [] List that stores the total time for each job. :type: :obj:`list(float)` .. py:attribute:: starts :value: [] List that stores the start time for each job. If the job is not running, :obj:`None` is stored instead. :type: :obj:`list(float)` .. py:method:: start(name) Start a job named :obj:`name`. If the job is not listed, register the job in the job list. Args: name (:obj:`str`): Name of the job to be started. Note: The job must not have started before calling this method. Returns: Does not return a value. .. py:method:: end(name) End a job named :obj:`name`. Increase the number of calls and the runtime for the job. Args: name (:obj:`str`): Name of the job to be ended. Note: The job must have started before calling this method. Returns: Does not return a value. .. py:method:: print() Print the list of jobs and their number of calls, total time and time per each call. Returns: Does not return a value. .. py:method:: export() Export the list of jobs and their number of calls and total time into a dictionary. Note: All jobs must be ended before calling this method. Returns: :obj:`dict` that contains "names", "calls", and "times" as keys .. py:method:: load(dict_) Load the list of jobs and their number of calls and total time from a dictionary. Args: `dict_` (:obj:`dict`): Dictionary that contains the list of jobs and their calls and times. Note: :obj:`dict_['names']`, :obj:`dict_['calls']` and :obj:`dict_['times']` must have the same size. Returns: Does not return a value