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
gjc@1727
     1
#include <iostream>
gjc@1727
     2
#include <vector>
gjc@1727
     3
#include <stdlib.h>
gjc@1727
     4
#include "ns3/event-collector.h"
gjc@1727
     5
#include "ns3/simulator.h"
gjc@1727
     6
gjc@1727
     7
using namespace ns3;
gjc@1727
     8
gjc@1727
     9
void Foo ()
gjc@1727
    10
{
gjc@1727
    11
gjc@1727
    12
}
gjc@1727
    13
gjc@1727
    14
int main (int argc, char *argv[])
gjc@1727
    15
{
gjc@1727
    16
    EventCollector events;
gjc@1727
    17
gjc@1727
    18
    if (argc < 3)
gjc@1727
    19
    {
gjc@1727
    20
        std::cerr << "usage: bench-event-collector NUM_EVENTS NUM_REPETITIONS" << std::endl;
gjc@1727
    21
        return 1;
gjc@1727
    22
    }
gjc@1727
    23
    int numEvents = atoi (argv[1]);
gjc@1727
    24
    int numRepetitions = atoi (argv[2]);
gjc@1727
    25
    
gjc@1727
    26
    for (int repetition = 0; repetition < numRepetitions; ++repetition)
gjc@1727
    27
    {
gjc@1727
    28
        for (int n = 0; n < numEvents; ++n)
gjc@1727
    29
        {
gjc@1727
    30
            events.Track (Simulator::Schedule (Simulator::Now (), Foo));
gjc@1727
    31
        }
gjc@1727
    32
        Simulator::Run ();
gjc@1727
    33
    }
gjc@1727
    34
}
gjc@1727
    35