code: def test_timeit(device):
      x = torch.randn(100, 16, device=device)
      lin = torch.nn.Linear(16, 32).to(device)
  
      with timeit(log=False) as t:
          assert not hasattr(t, "duration")
  
          with torch.no_grad():
              lin(x)
          t.reset()
          assert t.duration > 0
  
          del t.duration
          assert not hasattr(t, "duration")
      assert t.duration > 0
  
file_path: pytorch_geometric/test/profile/test_profile.py
imports: import os
  import os.path
  import warnings
  import pytest
  import torch
  import torch.nn.functional
  from torch_geometric.nn import GraphSAGE
  from torch_geometric.profile import get_stats_summary, profileit, rename_profile_file, timeit
  from torch_geometric.profile.profile import torch_profile, xpu_profile
  from torch_geometric.testing import onlyCUDA, onlyLinux, onlyOnline, onlyXPU, withCUDA, withPackage
label_desc: Use image node_id 1 for calling a global function with example usage: test_timeit(device) without return types