Advertisement
thornik

Bench 'StrCat' for D

Dec 5th, 2017
3,479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.27 KB | None | 0 0
  1. // ldc2.exe -release -m64 -O strcat.d
  2.  
  3. import std.stdio;
  4. import std.conv;
  5.  
  6. void main(string[] args)
  7. {
  8.     int n = args.length < 2 ? 1 : to!int(args[1]);
  9.     string hello;
  10.  
  11.     for (int i = 0; i < n; i++)
  12.         hello ~= "hello\n";
  13.  
  14.     writeln(hello.length);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement