utils/bench-event-collector.cc
author Josh Pelkey <jpelkey@gatech.edu>
Wed, 11 Aug 2010 11:37:37 -0400
changeset 6553 fb5ad9c7755a
permissions -rw-r--r--
update release notes and fix doxygen warnings
     1 #include <iostream>
     2 #include <vector>
     3 #include <stdlib.h>
     4 #include "ns3/event-collector.h"
     5 #include "ns3/simulator.h"
     6 
     7 using namespace ns3;
     8 
     9 void Foo ()
    10 {
    11 
    12 }
    13 
    14 int main (int argc, char *argv[])
    15 {
    16     EventCollector events;
    17 
    18     if (argc < 3)
    19     {
    20         std::cerr << "usage: bench-event-collector NUM_EVENTS NUM_REPETITIONS" << std::endl;
    21         return 1;
    22     }
    23     int numEvents = atoi (argv[1]);
    24     int numRepetitions = atoi (argv[2]);
    25     
    26     for (int repetition = 0; repetition < numRepetitions; ++repetition)
    27     {
    28         for (int n = 0; n < numEvents; ++n)
    29         {
    30             events.Track (Simulator::Schedule (Simulator::Now (), Foo));
    31         }
    32         Simulator::Run ();
    33     }
    34 }
    35