Subject:
|
Which way is faster?
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Fri, 13 Apr 2001 15:59:32 GMT
|
Viewed:
|
2619 times
|
| |
 | |
I want to know which way is faster:
1. Use three tasks to watch sensors
task watch1()
{
while (true) {
if () {
..
}
}
}
task watch2()
{
while (true) {
if () {
..
}
}
}
task watch3()
{
while (true) {
if () {
..
}
}
}
2. Use one task with multi if-else
task watch()
{
while (true) {
if () {
..
}
else if () {
..
}
else if () {
..
}
}
}
Zhengrong
|
|
Message has 1 Reply:  | | Re: Which way is faster?
|
| By "fastest", I assume you mean the smallest worst case latency between a condition happening and the RCX responding to it. Option #2 has the drawback that while the RCX is responding to one condition, it won't be looking for the other ones. So the (...) (24 years ago, 13-Apr-01, to lugnet.robotics.rcx.nqc)
|
2 Messages in This Thread:   
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|