Note
This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.
Get experiment timing information¶
Problem¶
You want to know when an experiment started and finished running.
Solution¶
The ExperimentData class contains timing information in the following attributes, which
are all of type datetime.datetime and in your local timezone:
ExperimentData.start_datetimeis when theExperimentDatawas instantiated, which is also when the experiment began running in the typical workflow by callingexperiment_data = exp.run().ExperimentData.end_datetimeis the time the most recently completed job was successfully added to theExperimentDataobject. If a job was canceled, did not run successfully, or could not be added to theExperimentDataobject for some other reason,ExperimentData.end_datetimewill not update.
Discussion¶
ExperimentData.start_datetime can also be set to a custom timestamp when instantiating an
ExperimentData object by passing a value to the start_datetime field.