root / trunk / docscripts / benchmarks / BenchmarkText.php

Revision 6072, 0.7 kB (checked in by pottedmeat, 2 years ago)

Updates to comment functionality

Line 
1<?php
2
3require_once('../lib/benchmark/Timer.php');
4require_once('../inc/Text.php');
5
6print '<h2>Text::toArray</h2>';
7
8$timer = new Benchmark_Timer();
9$timer->start();
10for ($i = 0; $i < 10000; $i++) {
11  Text::toArray('A string');
12}
13$timer->stop();
14$timer->display();
15
16print '<h2>Text::findTermination</h2>';
17
18$timer->start();
19for ($i = 0; $i < 1000; $i++) {
20  Text::findTermination(array(' function(key, value){},'), ',', '()[]{}');
21}
22$timer->stop();
23$timer->display();
24
25print '<h2>Text::findComments</h2>';
26
27$timer->start();
28for ($i = 0; $i < 1000; $i++) {
29  Text::findComments(' and more */ var example = Math.floor(/* floor this */ 1.5 /* to 1 */); // whatnot', true);
30}
31$timer->stop();
32$timer->display();
33
34?>
Note: See TracBrowser for help on using the browser.