HALCON测量算子或函数的运行时间

为了测量一系列算子的执行时间,应该关闭所有更新选项,以减少HDevelop中GUI更新对运行时间的影响。可以通过dev_update_pc、dev_update_time、dev_update_var和dev_update_window算子或dev_update_off函数来关闭更新项。

方法一:点击工具栏中的小闹钟图标,激活性能评测器,会在程序窗口的右侧出现小闹钟图标。在该图标的右侧点击显示运行时的统计,查看算子的运行时间。

dev_update_off()
gen_contour_polygon_xld (Contour1, [30,30,50,50,30], [100,200,200,100,100])
area_center_xld (Contour1, Area1, Row1, Column1, PointOrder)
gen_cross_contour_xld (Cross1, Row1, Column1, 6, 0.785398)
dev_update_on()

方法二:使用count_seconds()算子,测量算子的经过时间。

dev_update_off()
count_seconds (Start)
gen_contour_polygon_xld (Contour1, [30,30,50,50,30], [100,200,200,100,100])
area_center_xld (Contour1, Area1, Row1, Column1, PointOrder)
gen_cross_contour_xld (Cross1, Row1, Column1, 6, 0.785398)
count_seconds (End)
Seconds:=(End-Start) 
dev_update_on()

  • 6
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值