/// <summary> /// Int测试 /// </summary> static void Int测试() { int i; int n = 10000000; Console.WriteLine(""); Console.WriteLine("--------Int测试---------"); Stopwatch t = new Stopwatch(); t.Start(); //for (i = 0; i < n; i++) //{ // var str1 = JsonInteger.itoa(1000); //} //Console.WriteLine($"{n}条, 消耗{t.ElapsedMilliseconds}毫秒"); t.Restart(); for (i = 0; i < n; i++) { var str2 = Convert.ToString(1000); } Console.WriteLine($"Convert.ToString {n}条, 消耗{t.ElapsedMilliseconds}毫秒"); t.Restart(); for (i = 0; i < n; i++) { var str3 = QuickConvert.C2Str(1000); } Console.WriteLine($"C2Str {n}条, 消耗{t.ElapsedMilliseconds}毫秒"); t.Restart(); for (i = 0; i < n; i++) { var str2 = Convert.ToDouble("1.23"); } Console.WriteLine($"Convert.ToDouble {n}条, 消耗{t.ElapsedMilliseconds}毫秒"); t.Restart(); for (i = 0; i < n; i++) { var str3 = QuickConvert.C2Dbl("1.23"); } Console.WriteLine($"C2Dbl {n}条, 消耗{t.ElapsedMilliseconds}毫秒"); t.Stop(); Console.WriteLine(""); }
private void Form1_DragDrop(object sender, DragEventArgs e) { Data.InputFileType = InputTypetextbox.Text; Data.OutputFileType = OutputTypetextbox.Text; Data.X = int.Parse(Xtextbox.Text); Data.Y = int.Parse(Ytextbox.Text); Data.aspect_lock = aspect_ratioCheckBox.Checked; if (Data.OutputFolderPath == null) { var selectpath = new FolderSelecter().FolderSelect(); Data.OutputFolderPath = selectpath + @"\"; OutputtextBox.Text = selectpath + @"\"; Console.WriteLine("OutputPath: " + selectpath); } string[] files = (string[])e.Data.GetData(DataFormats.FileDrop, false); var quickcon = new QuickConvert(); quickcon.Run(files); }