diff --git a/docs/guides/max-execution-time.mdx b/docs/guides/max-execution-time.mdx index 66379ffa25b..5513b677b44 100644 --- a/docs/guides/max-execution-time.mdx +++ b/docs/guides/max-execution-time.mdx @@ -13,21 +13,23 @@ To ensure fairness and help control costs, there is a maximum amount of time eac The maximum execution time for a job is the smaller of these values: -- The value set for max_execution_time +- The value set for `max_execution_time` - The QPU-determined job timeout value The `max_execution_time` value is based on _quantum time_, not wall clock time. Quantum time is the time spent by the QPU complex to process the job. Simulator jobs use wall clock time because they do not have quantum time. -Set the maximum execution time (in seconds) on the job options by using one of the following methods: +Set the maximum execution time (in seconds) on the job options, as shown in the following example. See [Specify options](/guides/specify-runtime-options) for information about setting options. ```python -# Initiate the Options class with parameters -options = Options(max_execution_time=360) -``` +from qiskit_ibm_runtime import QiskitRuntimeService +from qiskit_ibm_runtime import EstimatorV2 as Estimator -```python -# Create the options object with attributes and values -options = {"max_execution_time": 360} +service = QiskitRuntimeService() +backend = service.least_busy(operational=True, simulator=False) + +estimator = Estimator(mode=backend) + +estimator.options.max_execution_time = 2500 ``` You can also find how much quantum time completed jobs have used by returning the job metrics as follows: