def METHOD_NAME(rosenbrock, facade):
    class CustomCallbackWalltime(Callback):
        def __init__(self, limit: float):
            self._limit = limit
        def on_tell_end(self, smbo, info: TrialInfo, value: TrialValue) -> bool | None:
            if smbo.used_walltime > self._limit:
                return False
            return
    LIMIT = 1
    FINAL_LIMIT = 8
    # Same thing now but with walltime limit
    scenario = Scenario(rosenbrock.configspace, n_trials=99999, walltime_limit=FINAL_LIMIT, min_budget=1, max_budget=10)
    smac = facade(scenario, rosenbrock.train, callbacks=[CustomCallbackWalltime(LIMIT)], overwrite=True)
    smac.optimize()
    assert smac._optimizer.used_walltime > LIMIT and smac._optimizer.used_walltime < FINAL_LIMIT
    # Now we want to continue the run
    scenario = Scenario(rosenbrock.configspace, n_trials=99999, walltime_limit=FINAL_LIMIT, min_budget=1, max_budget=10)
    smac2 = facade(scenario, rosenbrock.train, logging_level=0)
    # Let's see if we restored the runhistory correctly; used walltime should be roughly the same
    # However, since some more things happen in the background, it might be slightly different
    assert pytest.approx(smac2._optimizer.used_walltime, 0.5) == smac._optimizer.used_walltime
    assert smac2.runhistory.finished == smac.runhistory.finished
    smac2.optimize()
    assert smac2.runhistory.finished > smac.runhistory.finished
    assert smac2._optimizer.used_walltime > FINAL_LIMIT