public static long InsertionTime(float[] array, TimeType type) => InsertionAlgorithm.Time(array, type); //returns time /// <summary> /// Returns prepared message of duration in ticks. /// </summary> /// <param name="array">Float array to sort.</param> /// <param name="type">Type of returned duration.</param> public static string InsertionTimePrint(float[] array, TimeType type) { if (type == TimeType.Both) { return(string.Format("Insertion Sorting Duration: {0} Miliseconds / {1} Ticks.", InsertionAlgorithm.Time(array, TimeType.Miliseconds), InsertionAlgorithm.Time(array, TimeType.Ticks))); //returns preprepared messageof time } return(string.Format("Insertion Sorting Duration: {0} {1}", InsertionAlgorithm.Time(array, type), type == TimeType.Ticks ? "Ticks." : "Miliseconds.")); //returns preprepared message of time }
/// <summary> /// Returns duration of algorithm calculations in ticks. /// </summary> /// <param name="array">Float array to sort.</param> /// <param name="type">Type of returned duration.</param> public static long InsertionTime(float[] array, TimeType type) => InsertionAlgorithm.Time(array, type); //returns time