Skip to content
Browse files

Minor changes

  • Loading branch information...
1 parent c5f2778 commit 098f9f322806d333f45a4751f5880fe46db2a12b @andralex committed Jun 15, 2011
Showing with 32 additions and 29 deletions.
  1. +32 −29 std/benchmark.d
View
61 std/benchmark.d
@@ -665,47 +665,50 @@ void benchmarkModule(string mod)(File target = stdout)
}
}
-void benchmark_fileWrite()
+version(StdRunBenchmarks)
{
- std.file.write("/tmp/deleteme", "hello, world!");
-}
+ private void benchmark_fileWrite()
+ {
+ std.file.write("/tmp/deleteme", "hello, world!");
+ }
-void benchmark_fileRead()
-{
- std.file.read("/tmp/deleteme");
-}
+ private void benchmark_fileRead()
+ {
+ std.file.read("/tmp/deleteme");
+ }
-void benchmark_append_builtin(uint n)
-{
- string a;
- foreach (i; 0 .. n)
+ private void benchmark_append_builtin(uint n)
{
- a ~= 'x';
+ string a;
+ foreach (i; 0 .. n)
+ {
+ a ~= 'x';
+ }
}
-}
-void benchmark_append_appender(uint n)
-{
- import std.range;
- auto a = appender!string();
- foreach (i; 0 .. n)
+ private void benchmark_append_appender(uint n)
{
- put(a, 'x');
+ import std.range;
+ auto a = appender!string();
+ foreach (i; 0 .. n)
+ {
+ put(a, 'x');
+ }
}
-}
-void benchmark_append_concat(uint n)
-{
- string a;
- foreach (i; 0 .. n)
+ private void benchmark_append_concat(uint n)
{
- a = a ~ 'x';
+ string a;
+ foreach (i; 0 .. n)
+ {
+ a = a ~ 'x';
+ }
}
-}
-unittest
-{
- version(StdRunBenchmarks) benchmarkModule!"std.benchmark"();
+ unittest
+ {
+ benchmarkModule!"std.benchmark"();
+ }
}
// One benchmark stopwatch

0 comments on commit 098f9f3

Please sign in to comment.
Something went wrong with that request. Please try again.