|
Bugzilla – Full Text Bug Listing |
| Summary: | Wrong example for Time ns3::Now (void) | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | zhangbo2050 |
| Component: | documentation | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED INVALID | ||
| Severity: | trivial | CC: | craigdo, tomh |
| Priority: | P5 | ||
| Version: | ns-3.7 | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://www.nsnam.org/doxygen-release/index.html | ||
|
Description
zhangbo2050
2010-04-27 22:46:36 UTC
Unless I'm hallucinating: Simulator::Schedule (Seconds (2.0) + Now (), &my_function); If Now() is 0 seconds, this schedules an event for 2 + 0 = 2 seconds in the future; at absoulute 0 + 2 = 2 seconds. If Now() is 1 seconds, this schedules an event for 2 + 1 = 3 seconds in the future; at absoulte time 1 + 3 = 4 seconds. If Now() is 2 seconds, this schedules an event for 2 + 2 = 4 seconds in the future; at absolute time 2 + 4 = 6 seconds. However, in this case: Simulator::Schedule (Seconds (2.0) - Now (), &my_function); If Now() is 0 seconds, this schedules an event for 2 - 0 = 2 seconds in the future; at absolute time 0 + 2 = 2 seconds. If Now() is 1 seconds, this schedules an event for 2 - 1 = 1 seconds in the future; at absolute time 1 + 1 = 2 seconds. If Now() is 2 seconds, this schedules an event for 2 - 2 = 0 seconds in the future; at absolute time 2 + 0 = 2 seconds. It seems to me that the comment is correct. |