# How to measure a quantum circuit's execution time on a real IBM device?

Quantum Computing Asked by Alfred on December 14, 2020

I am executing a quantum circuit on an IBM quantum device and I need to start a timer as soon as the job in the queue starts running. I have already used:

result = job.result()
execution_time = result.time_taken


but in this particular case what I need is more like a "signal", like a variable that is switched on as soon as the queue is over and causes the timer to start. I tried using the job status but it didn’t seem to work.

result.time_taken is the execution time. There is also job.time_per_step() that gives you the timestamps of each step of the job's life cycle.

If you're looking to set some variable locally in your program, the best you can do is probably use job status. job.wait_for_final_state() supports a callback function that you can use to set the variable when status changes.

Answered by jyu00 on December 14, 2020

## Related Questions

### How do I “add” two qubit states?

1  Asked on August 20, 2021 by visipi

### How to transform a state with amplitude squared or to any power?

1  Asked on August 20, 2021 by m-chen

### Can any channel be written as $Phi(X)=operatorname{Tr}_{mathcal Z}[U(Xotimes sigma)U^dagger]$ for any state $sigma$?

1  Asked on August 20, 2021

### How to remove ancilla bits from results?

1  Asked on August 20, 2021 by requiem

### What is the set of all functions from ℤ to ℤ?

2  Asked on August 20, 2021

### Why should we use density matrices to simulate quantum systems with noise?

2  Asked on August 20, 2021 by henry_fordham

### What is the implication of locality in QAOA?

1  Asked on August 20, 2021

### Given a channel $Phi(X)=sum_k c_k(X)sigma_k$, are there always $F_kge0$ such that $Phi(X)=sum_k operatorname{tr}(F_k X)sigma_k$?

1  Asked on August 20, 2021

### Frequency collision and crosstalk error

0  Asked on August 20, 2021 by peachnuts

### Is Deutsch 1985b wrong about and Quantum Parallelism?

1  Asked on August 20, 2021 by vy32

### Computing cross-correlations on a quantum computer

1  Asked on August 20, 2021 by arc111

### Finding a class $C$ of bipartite PPT states such that entanglement of $rho in C$ implies entanglement of $rho + rho^{Gamma}$

0  Asked on August 20, 2021 by mathwizard

### How to implement an Oracle

1  Asked on August 20, 2021

### VQE jobs do not appear in queue

1  Asked on August 20, 2021

### Meaning behind obtaining a hermitian operator for measurement in another basis?

2  Asked on August 20, 2021 by gaussstrife

### Is there a standard way to save pulse schedules akin to a qasm for a circuit?

1  Asked on August 20, 2021

### How to create an arbitrary state in QISKit for a local_qasm_simulator?

1  Asked on August 19, 2021

### Lower Bound to Measure Entanglement in Mixed States

1  Asked on August 19, 2021

### Is there a way to construct a quantum circuit/oracle to check if 2 qubits in an unknown pure state are entangled?

2  Asked on August 19, 2021

### Hadamard Test to calculate imaginary part

2  Asked on August 18, 2021