Linux server1.dn-server.com 4.18.0-553.89.1.lve.el8.x86_64 #1 SMP Wed Dec 10 13:58:50 UTC 2025 x86_64
LiteSpeed
Server IP : 195.201.204.189 & Your IP : 216.73.216.37
Domains :
Cant Read [ /etc/named.conf ]
User : beriska1
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
alt /
ruby19 /
share /
ri /
1.9.1 /
system /
Benchmark /
Delete
Unzip
Name
Size
Permission
Date
Action
Tms
[ DIR ]
drwxr-xr-x
2026-05-01 04:24
benchmark-c.ri
1.95
KB
-rw-r--r--
2023-07-26 17:26
benchmark-i.ri
1.95
KB
-rw-r--r--
2023-07-26 17:26
bm-c.ri
983
B
-rw-r--r--
2023-07-26 17:26
bm-i.ri
983
B
-rw-r--r--
2023-07-26 17:26
bmbm-c.ri
1.76
KB
-rw-r--r--
2023-07-26 17:26
bmbm-i.ri
1.76
KB
-rw-r--r--
2023-07-26 17:26
cdesc-Benchmark.ri
4.51
KB
-rw-r--r--
2023-07-26 17:26
measure-c.ri
289
B
-rw-r--r--
2023-07-26 17:26
measure-i.ri
289
B
-rw-r--r--
2023-07-26 17:26
realtime-c.ri
261
B
-rw-r--r--
2023-07-26 17:26
realtime-i.ri
261
B
-rw-r--r--
2023-07-26 17:26
Save
Rename
U:RDoc::NormalModule[iI"Benchmark:EF@0o:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"IThe Benchmark module provides methods to measure and report the time;TI"used to execute Ruby code.;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[ o; ;[I"EMeasure the time to construct the string given by the expression;TI"<tt>"a"*1_000_000</tt>:;T@o:RDoc::Markup::Verbatim;[I"require 'benchmark' ;FI" ;FI".puts Benchmark.measure { "a"*1_000_000 } ;Fo; ;[I">On my machine (FreeBSD 3.2 on P5, 100MHz) this generates:;T@o;;[I"11.166667 0.050000 1.216667 ( 0.571355) ;Fo; ;[I"EThis report shows the user CPU time, system CPU time, the sum of;TI"Gthe user and system CPU times, and the elapsed real time. The unit;TI"of time is seconds.;T@o;;0;[o; ;[I";Do some experiments sequentially using the #bm method:;T@o;;[ I"require 'benchmark' ;FI" ;FI"n = 50000 ;FI"Benchmark.bm do |x| ;FI"0 x.report { for i in 1..n; a = "1"; end } ;FI"0 x.report { n.times do ; a = "1"; end } ;FI"0 x.report { 1.upto(n) do ; a = "1"; end } ;FI" end ;Fo; ;[I"The result:;T@o;;[ I"0 user system total real ;FI"11.033333 0.016667 1.016667 ( 0.492106) ;FI"11.483333 0.000000 1.483333 ( 0.694605) ;FI"11.516667 0.000000 1.516667 ( 0.711077) ;Fo;;0;[o; ;[I"AContinuing the previous example, put a label in each report:;T@o;;[ I"require 'benchmark' ;FI" ;FI"n = 50000 ;FI"Benchmark.bm(7) do |x| ;FI": x.report("for:") { for i in 1..n; a = "1"; end } ;FI": x.report("times:") { n.times do ; a = "1"; end } ;FI": x.report("upto:") { 1.upto(n) do ; a = "1"; end } ;FI" end ;Fo; ;[I"The result:;T@o;;[ I"9 user system total real ;FI":for: 1.050000 0.000000 1.050000 ( 0.503462) ;FI":times: 1.533333 0.016667 1.550000 ( 0.735473) ;FI":upto: 1.500000 0.016667 1.516667 ( 0.711239) ;Fo;;; ;[o;;0;[o; ;[ I"EThe times for some benchmarks depend on the order in which items;TI">are run. These differences are due to the cost of memory;TI"Eallocation and garbage collection. To avoid these discrepancies,;TI"Cthe #bmbm method is provided. For example, to compare ways to;TI"sort an array of floats:;T@o;;[ I"require 'benchmark' ;FI" ;FI"'array = (1..1000000).map { rand } ;FI" ;FI"Benchmark.bmbm do |x| ;FI"- x.report("sort!") { array.dup.sort! } ;FI"- x.report("sort") { array.dup.sort } ;FI" end ;Fo; ;[I"The result:;T@o;;[ I"9Rehearsal ----------------------------------------- ;FI"9sort! 11.928000 0.010000 11.938000 ( 12.756000) ;FI"9sort 13.048000 0.020000 13.068000 ( 13.857000) ;FI"9------------------------------- total: 25.006000sec ;FI" ;FI"8 user system total real ;FI"9sort! 12.959000 0.010000 12.969000 ( 13.793000) ;FI"9sort 12.007000 0.000000 12.007000 ( 12.791000) ;Fo;;0;[o; ;[I"DReport statistics of sequential experiments with unique labels,;TI"!using the #benchmark method:;T@o;;[I"require 'benchmark' ;FI"Jinclude Benchmark # we need the CAPTION and FORMAT constants ;FI" ;FI"n = 50000 ;FI"HBenchmark.benchmark(CAPTION, 7, FORMAT, ">total:", ">avg:") do |x| ;FI"? tf = x.report("for:") { for i in 1..n; a = "1"; end } ;FI"? tt = x.report("times:") { n.times do ; a = "1"; end } ;FI"? tu = x.report("upto:") { 1.upto(n) do ; a = "1"; end } ;FI" [tf+tt+tu, (tf+tt+tu)/3] ;FI" end ;Fo; ;[I"The result:;T@o;;[I"9 user system total real ;FI":for: 1.016667 0.016667 1.033333 ( 0.485749) ;FI":times: 1.450000 0.016667 1.466667 ( 0.681367) ;FI":upto: 1.533333 0.000000 1.533333 ( 0.722166) ;FI":>total: 4.000000 0.033333 4.033333 ( 1.889282) ;FI"9>avg: 1.333333 0.011111 1.344444 ( 0.629761);F: @fileI"lib/benchmark.rb;T;0[ [[I"BENCHMARK_VERSION;Fo;;[ ;0@�[I"CAPTION;Fo;;[o; ;[I"AThe default caption string (heading above the output times).;T;0@�[I"FORMAT;Fo;;[o; ;[I"VThe default format string used to display times. See also Benchmark::Tms#format.;T;0@�[ [[I" class;F[[:public[ [I"benchmark;F@�[I"bm;F@�[I" bmbm;F@�[I"measure;F@�[I" realtime;F@�[:protected[ [:private[ [I" instance;F[[;[ [;[ [;[ [@�@�[@�@�[@�@�[@�@�[@�@�