Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 44 lines (32 sloc) 0.901 kB
2ad56da @jimrubenstein Created a demo for showing how the profiler works.
jimrubenstein authored
1 <?
2
b66d2ce @trevyn set default timezone, correct sub-second sleeps
trevyn authored
3 date_default_timezone_set("UTC");
4
2ad56da @jimrubenstein Created a demo for showing how the profiler works.
jimrubenstein authored
5 require "../profiler.php";
6 Profiler::enable();
7
8 ProfilerRenderer::setIncludeJquery(true);
9 ProfilerRenderer::setJqueryLocation('https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');
10
11 ProfilerRenderer::setPrettifyLocation("../code-prettify");
12
13 $s1 = Profiler::start('Step 1');
14 //do some important things!
b66d2ce @trevyn set default timezone, correct sub-second sleeps
trevyn authored
15 usleep(500000); // 0.5 sec
2ad56da @jimrubenstein Created a demo for showing how the profiler works.
jimrubenstein authored
16 $s1->end();
17
18 $s2 = Profiler::start('Step 2');
19 //more important things
b66d2ce @trevyn set default timezone, correct sub-second sleeps
trevyn authored
20 usleep(100000); // 0.1 sec
2ad56da @jimrubenstein Created a demo for showing how the profiler works.
jimrubenstein authored
21
22 $s3 = Profiler::start('Step 3');
23 //some nested things..that are important and stuff.
24 sleep(1);
25
26 $sql = Profiler::sqlStart("SELECT * FROM TABLE WHERE 1");
b66d2ce @trevyn set default timezone, correct sub-second sleeps
trevyn authored
27 usleep(1500000); // 1.5 sec
2ad56da @jimrubenstein Created a demo for showing how the profiler works.
jimrubenstein authored
28 $sql->end();
29
30 $s3->end();
31 $s2->end();
32 ?>
33 <!DOCTYPE html>
34 <head>
35 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
36 <title>php-profiler demo</title>
37 </head>
38 <body>
39
40 <? Profiler::render(); ?>
41
42 </body>
43 </html>
44
Something went wrong with that request. Please try again.