fork download
  1. using static System.Console;
  2. using System.Diagnostics;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. var x = "";
  7. var sw = new Stopwatch();
  8. sw.Start();
  9. for (var i = 0; i < 10000; i++) x = string.Format("teste de string formatada com resultado: {0}", i + 5);
  10. sw.Stop();
  11. WriteLine(sw.ElapsedTicks);
  12. sw.Restart();
  13. for (var i = 0; i < 10000; i++) x = $"teste de string formatada com resultado: {i + 5}";
  14. sw.Stop();
  15. WriteLine(sw.ElapsedTicks);
  16. }
  17. }
  18.  
  19. //https://pt.stackoverflow.com/q/93207/101
Success #stdin #stdout 0.03s 19616KB
stdin
Standard input is empty
stdout
61570
53047