eakn
eakn

Reputation: 311

How to get current simulation time in omnet++?

I am measuring energy level when the packet comes to one of the specific LCN from anothers.I want to get the current simulation time when packet arrives to this LCN.To do this, I used

SimTime();

function but it always gives me the 0. So, how can I get current simulation time. I need to draw the energy level of the LCN with respect to time until simulation ends.I mean what is energy level of of LCN when the time is 10? (for example)

Upvotes: 1

Views: 2426

Answers (1)

floxyz
floxyz

Reputation: 686

When you call SimTime() you actually call the constructor for the class SimTime.

What you are looking for is the global function simTime().

Upvotes: 4

Related Questions