try catch子句会影响性能吗? [英] does try catch clause affect performance?

查看:105
本文介绍了try catch子句会影响性能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在 try 块中没有引发异常, try/catch 是否会影响性能?
try/catch/finally 怎么样?

does try/catch affects performance if no exception thrown in try block?
how about try/catch/finally?

推荐答案

try/catch try/catch/finally 都不会在很大程度上影响性能.当然,创建的异常 do 会影响性能(即是否捕获到异常)

Neither try/catch nor try/catch/finally affects performance to any significant degree. Exceptions being created do affect performance, of course (and that is whether they are caught, or not)

>尝试/捕获块会影响性能什么时候不抛出异常?

这篇关于try catch子句会影响性能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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