code: def test_factorial():
      print(
          "\n# ======================================================================"
      )
      print("#                               Factorial")
      print(
          "# ======================================================================\n"
      )
  
      if C is not None:
          c = C.getcontext()
          c.prec = C.MAX_PREC
          c.Emax = C.MAX_EMAX
          c.Emin = C.MIN_EMIN
  
      for n in [100000, 1000000]:
          print("n = %d\n" % n)
  
          if C is not None:
              # C version of decimal
              start_calc = time.time()
              x = factorial(C.Decimal(n), 0)
              end_calc = time.time()
              start_conv = time.time()
              sx = str(x)
              end_conv = time.time()
              print("cdecimal:")
              print("calculation time: %fs" % (end_calc - start_calc))
              print("conversion time: %fs\n" % (end_conv - start_conv))
  
          # Python integers
          start_calc = time.time()
          y = factorial(n, 0)
          end_calc = time.time()
          start_conv = time.time()
          sy = str(y)
          end_conv = time.time()
  
          print("int:")
          print("calculation time: %fs" % (end_calc - start_calc))
          print("conversion time: %fs\n\n" % (end_conv - start_conv))
  
          if C is not None:
              assert sx == sy
  
file_path: cpython/Modules/_decimal/tests/bench.py
imports: import time
  import sys
  from functools import wraps
  from test.support.import_helper import import_fresh_module
label_desc: Use image node_id 7 for calling a global function with example usage: test_factorial() without return types