code: def test_duration_criterion() -> None:
      optim = optimizerlib.OnePlusOne(2, budget=100)
      crit = ng.callbacks._DurationCriterion(0.01)
      assert not crit(optim)
      assert not crit(optim)
      assert not crit(optim)
      time.sleep(0.01)
      assert crit(optim)
  
imports: import time
  from pathlib import Path
  import logging
  import os
  import numpy
  import nevergrad
  import nevergrad.common.typing
  from .None import optimizerlib
  from .None import callbacks
label_desc: Use image node_id 8 for calling a global function with example usage: test_duration_criterion() without return types