You should post the whole loop code into the question so we can have a better view.
你应该后整个循环代码的问题使我们能够有一个更好的观点。
The new loop code has two fewer operations per iteration, which can lead to increasing performance gains as the number of iterations increases.
新循环代码每次迭代中减少两个操作,随着迭代次数的增长,性能将显著提升。
Because the hint is before the loop body, this code leaves your hint active for every iteration of the loop, but it only has to use one cycle.
由于提示位于循环体之前,因此这段代码将使提示对于循环的每次迭代都保持活动状态,不过它只使用了一个周期。
For example, the code in Listing 3 prints a note after each number in the loop.
举例来说,清单3中的代码会在循环中为各编号输出一个说明。
Then, break the execution and find the assembly code representing the infinite loop.
然后,中断执行并找到表示该无限循环的汇编代码。
For tasks that execute code in a loop, it is common to check for interruption only once per loop iteration.
对于执行一个循环中的代码的任务,通常只需为每一个循环迭代检查一次中断。
Moving this code outside the loop could fix the problem.
从循环中去掉这些代码就可以解决这个问题。
It is entirely possible to stop, refactor, be a little behind on features, slam in a few features, not catch up but screw up the code, and loop forever, never getting benefit.
停下来、重构、稍微落后于特性、专注于少量特性、不赶进度而是优化代码,如此循环往复,却从来不受益;这样的状况完全有可能。
For loop conformance, consider the code snippet in Listing 3.
对于循环的一致性,可以考虑清单3中的代码片段。
Some memory leaks occur due to program errors in which infinite loop in the application code allocates new objects and adds them to a data structure accessible from outside the program loop scope.
有些内存泄漏是由于程序错误发生的,在存在此类错误的情况下,应用程序代码中的无限循环会分配新的对象,并将其添加到可从程序循环范围外面访问的数据结构中。
In this example, the code block is iterated until the loop is broken through the condition.
在此示例中,代码块迭代,直至循环根据条件而中断。
Your code should (almost) never have multiple nested loops (a loop inside a loop inside a loop). Most of the code written today should use Hashtables, simple lists and singly nested loops.
在编写代码时应尽量避免嵌套循环,目前大多数代码都是使用了哈希表、简单链表和单循环。
The code for the loop is displayed in Listing 12.
清单12展示了该循环的代码。
All right, you can see that this little piece of code, it's got a loop in there, and what's it doing?
好,你们看到的这一小块代码,是做了一个循环吧?,他在做什么?
For example, code that might go into an infinite loop, or otherwise use excessive resources, must be wrapped in testing code that will detect such eventualities.
例如,必须在专门的测试代码中捕捉到占用大量资源的无限循环代码。
In the main program loop, there is no need for the code that ignores the header lines and the first two lines of input.
在主程序循环中,代码无需忽略标题行和输入的前两行。
Let's say you're going to time 200,000 iterations through a loop, and the compiled code is 10 times faster than the interpreted code.
假设您正在通过循环计时200,000次迭代,编译代码比解释代码快10倍。
And in the code before the loop, add.
在循环之前的代码中,添加以下内容。
Add this code to the end of the iterator loop
将下列代码添加到迭代器循环的底部
The compiler translates this code into the equivalent iterator-based loop, as shown in Listing 2.
编译器把这个代码转换成等价的基于迭代器的循环,如清单2所示。
The cure for this problem is to perform the little.readlines loop in the above code.
这个问题的解决方法是在以上代码中执行小小的. readlines循环。
Add protocol-specific elements, transactions, a loop, a comment, conditional processing, and custom code.
添加特定协议元素、事务、循环、注释、条件处理和定制代码。
When the loop is finished, the code will have a fully populated Channel object and a list of fully populated Item objects.
循环结束时,代码将拥有一个完全填充的Channel对象和一个完全填充的Item对象列表。
This makes the SELECT clause a code loop.
这使select子句成为代码循环。
The code inside the loop (pump the Thread.sleep ) keeps the service running and listening for messages.
循环中的代码(pump 、Thread. sleep)使服务一直运行,并侦听消息。
For a while loop, however, this means the code in the else clause is executed once, after the loop is terminated (see the pseudocode shown in Listing 7).
但是对于while循环,这意味着在循环终止后,else子句中的代码被执行一次(参见清单7中的伪代码)。
It holds the activation records (i.e. stack frames) of native code, and VM code including the interpreter loop function.
它掌握本地代码的活动记录(堆帧stack frames),VM代码包括解释器循环功能。
That’s the little bit of trigonometry code at the beginning of the foreach loop.
在foreach 循环的开始有一些三角函数的代码。
At the end of the day, you can implement the exact same program using a while loop that you can using a for loop, it's just your code is going to look slightly different.
最终,你可以执行这个程序,再使用for循环的地方使用while循环,这只是使你的代码看起来稍微有点不同。
At the end of the day, you can implement the exact same program using a while loop that you can using a for loop, it's just your code is going to look slightly different.
最终,你可以执行这个程序,再使用for循环的地方使用while循环,这只是使你的代码看起来稍微有点不同。
应用推荐