File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ public class UnitsNetBenchmarks
13
13
[ Benchmark ]
14
14
public Length Constructor ( ) => new Length ( 3.0 , LengthUnit . Meter ) ;
15
15
16
+ [ Benchmark ]
17
+ public Length Constructor_SI ( ) => new Length ( 3.0 , UnitSystem . SI ) ;
18
+
16
19
[ Benchmark ]
17
20
public Length FromMethod ( ) => Length . FromMeters ( 3.0 ) ;
18
21
@@ -22,9 +25,15 @@ public class UnitsNetBenchmarks
22
25
[ Benchmark ]
23
26
public double As ( ) => length . As ( LengthUnit . Centimeter ) ;
24
27
28
+ [ Benchmark ]
29
+ public double As_SI ( ) => length . As ( UnitSystem . SI ) ;
30
+
25
31
[ Benchmark ]
26
32
public Length ToUnit ( ) => length . ToUnit ( LengthUnit . Centimeter ) ;
27
33
34
+ [ Benchmark ]
35
+ public Length ToUnit_SI ( ) => length . ToUnit ( UnitSystem . SI ) ;
36
+
28
37
[ Benchmark ]
29
38
public string ToStringTest ( ) => length . ToString ( ) ;
30
39
@@ -43,6 +52,9 @@ public class UnitsNetBenchmarks
43
52
[ Benchmark ]
44
53
public double IQuantity_As ( ) => lengthIQuantity . As ( LengthUnit . Centimeter ) ;
45
54
55
+ [ Benchmark ]
56
+ public double IQuantity_As_SI ( ) => lengthIQuantity . As ( UnitSystem . SI ) ;
57
+
46
58
[ Benchmark ]
47
59
public IQuantity IQuantity_ToUnit ( ) => lengthIQuantity . ToUnit ( LengthUnit . Centimeter ) ;
48
60
You can’t perform that action at this time.
0 commit comments