Class: Nasl::CommandBenchmark
Class Method Summary
collapse
Methods inherited from Command
all, banner, find, inherited, initialize!, run
Class Method Details
.analyze(cfg, path, args) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/nasl/commands/benchmark.rb', line 35
def self.analyze(cfg, path, args)
Benchmark.bmbm do |b|
contents = File.open(path, "rb").read
b.report("Tokenize") do
cfg[:iterations].times { Tokenizer.new(contents, path).get_tokens }
end
b.report("Parse") do
cfg[:iterations].times { Parser.new.parse(contents) }
end
end
end
|
.binding ⇒ Object
31
32
33
|
# File 'lib/nasl/commands/benchmark.rb', line 31
def self.binding
'benchmark'
end
|