Speed#

from IPython.display import Markdown
from time import time

t1 = time()
from openfisca_us import Microsimulation

t2 = time()
sim = Microsimulation()
t3 = time()
sim.calc("spm_unit_benefits")
sim.calc("spm_unit_taxes")
t4 = time()

Markdown(
    f"The time to import `Microsimulation` from `openfisca_us` is {t2 - t1:.01f} seconds. The time to initialise a `Microsimulation` object is {t3 - t2:.01f} seconds, and the time to complete simulation of taxes and benefits is {t4 - t3:.01f} seconds."
)

The time to import Microsimulation from openfisca_us is 2.1 seconds. The time to initialise a Microsimulation object is 5.7 seconds, and the time to complete simulation of taxes and benefits is 10.0 seconds.