在Eclipse中进行大量迭代后循环中的断点 [英] Breakpoint in loop after large number of iterations in Eclipse

查看:126
本文介绍了在Eclipse中进行大量迭代后循环中的断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有以下代码.在调试时,我希望Eclipse在完成一百万次迭代后停止.这该怎么做?我不能手动做一百万次.

Suppose I have the following code. While debugging, I want Eclipse to stop when it has done 1 million iterations. How to do this? I cannot manually do 1 million times.

for(int i = 0; i < 10000000; i++) {
    //some code
}

推荐答案

您可以在eclipse中放置条件断点:

You can put conditional break point in eclipse:

  1. 放置一个断点
  2. 右键单击->属性
  3. 打开条件"复选框
  4. 输入条件代码

  1. Put a breakpoint
  2. Right-click->Properties
  3. Turn on "condition" check-box
  4. Put condition code

i == 1000000

i == 1000000

这篇关于在Eclipse中进行大量迭代后循环中的断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆