【发布时间】:2014-11-13 23:00:02
【问题描述】:
两种转换的执行时间相同还是不同?.net 是如何进行转换的
float j = r;
decimal e = Convert.ToDecimal(j);in convert class using todecimal method is converting to decimal
decimal tt=(decimal)j;// How does this work in casting (Exactly How boxing and unboxing works)
【问题讨论】:
-
为什么不自己测量呢?
-
默认答案:“如果你有两匹马,你想知道哪两匹马跑得更快,那就和你的马赛跑吧。”ericlippert.com/2012/12/17/performance-rant
-
我看到语法上的唯一区别@SonerGönül
-
如果你分解
Convert.ToDecimal(float value),则源是return (decimal)value; -
对不起,但对我来说这个问题很愚蠢-1!
标签: c# types type-conversion