public void TupleIndexTimed() { object tup = Tupler.Create(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20); Timer.Action1 = () => Tupler.Index(tup, 14); Timer.Action2 = () => FSharpValue.GetTupleField(tup, 14); var elapsed = Timer.Go(50000); Console.WriteLine("Impromptu: " + elapsed.Item1); Console.WriteLine("FSharp Refelection: " + elapsed.Item2); Console.WriteLine("Impromptu VS FSharp Reflection: {0}", TimeIt.RelativeSpeed(elapsed)); Assert.Less(elapsed.Item1, elapsed.Item2); }
public void DynamicTupleIndex19() { var tup = Tupler.Create(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20); Assert.That(Tupler.Index(tup, 19), Is.EqualTo(20)); }