time_dbi()
{

  // Create the Job Controller.
  JobC j;
  
  // Ask it to create the "Demo" path.
  j.Path.Create("Demo","");

  // Add another node to the Demo path
  j.Path.Add("Demo","RootCommand::Ana");

  // Configure the RootCommand module 
  // Tell it what it should do every time its Ana method is called
  j.Path("Demo").Mod("RootCommand").Cmd("AddLine/Ana myAnaTimeDbi(mom)");
  
  //  Tell JobControl to run the path 10 times
  j.Path("Demo").RunNin(10);

}

void myAnaTimeDbi(const MomNavigator* mom) 
{
  RawRecord* raw = dynamic_cast<RawRecord*>(mom->GetFragment("RawRecord"));
  const VldContext* vc = raw->GetVldContext();   

  TStopwatch t;   
  t.Start();
  DbiResultPtr<PlexPixelSpotToStripEnd> rptr(*vc);
  t.Stop();
  UInt_t numRows = rptr.GetNumRows();
  cout << "There are " << numRows << " rows" 
       << " cpu " << t.CpuTime()  << " elapse " << t.RealTime() << endl;
}
