Groups
Groups
Sign in
Groups
Groups
OMNeT++ Users
Conversations
Labels
About
Send feedback
Help
how to get simulation time
16 views
Skip to first unread message
Edd Drusti
unread,
Jul 14, 2009, 7:23:44 AM
7/14/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to omnetpp
How can I get the simulation time in any module?
In the class SimTime is no method that gets simulation time?!
I need to define a variable (of type simtime_t or similar) and then
get the simulation time before/after some event occured.
I need something like this:
simtime_t mytime;
event x;
mytime = getSimTime();
...
event y;
timedifference=getSimTime()-mytime;
EV << "Time difference is:" + timedifference +" s \n";
Thanks
Rudolf Hornig
unread,
Jul 14, 2009, 8:22:58 AM
7/14/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to omn...@googlegroups.com
You almost got it (see the documentation for cSimpleModule):
mytime =
simTime()
;
Edd Drusti
unread,
Jul 14, 2009, 9:04:35 AM
7/14/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to omnetpp
:-)
Thanks anyway Rudolph.
On 14 Jul., 14:22, Rudolf Hornig <
rudolf.hor...@gmail.com
> wrote:
> You almost got it (see the documentation for cSimpleModule):
>
> mytime = *simTime()*;
Reply all
Reply to author
Forward
0 new messages