|
Revision 6072, 0.7 kB
(checked in by pottedmeat, 2 years ago)
|
|
Updates to comment functionality
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | require_once('../lib/benchmark/Timer.php'); |
|---|
| 4 | require_once('../inc/Text.php'); |
|---|
| 5 | |
|---|
| 6 | print '<h2>Text::toArray</h2>'; |
|---|
| 7 | |
|---|
| 8 | $timer = new Benchmark_Timer(); |
|---|
| 9 | $timer->start(); |
|---|
| 10 | for ($i = 0; $i < 10000; $i++) { |
|---|
| 11 | Text::toArray('A string'); |
|---|
| 12 | } |
|---|
| 13 | $timer->stop(); |
|---|
| 14 | $timer->display(); |
|---|
| 15 | |
|---|
| 16 | print '<h2>Text::findTermination</h2>'; |
|---|
| 17 | |
|---|
| 18 | $timer->start(); |
|---|
| 19 | for ($i = 0; $i < 1000; $i++) { |
|---|
| 20 | Text::findTermination(array(' function(key, value){},'), ',', '()[]{}'); |
|---|
| 21 | } |
|---|
| 22 | $timer->stop(); |
|---|
| 23 | $timer->display(); |
|---|
| 24 | |
|---|
| 25 | print '<h2>Text::findComments</h2>'; |
|---|
| 26 | |
|---|
| 27 | $timer->start(); |
|---|
| 28 | for ($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 | ?> |
|---|