当前位置: 首页>>代码示例>>PHP>>正文


PHP ParlDB::display_total_duration方法代码示例

本文整理汇总了PHP中ParlDB::display_total_duration方法的典型用法代码示例。如果您正苦于以下问题:PHP ParlDB::display_total_duration方法的具体用法?PHP ParlDB::display_total_duration怎么用?PHP ParlDB::display_total_duration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ParlDB的用法示例。


在下文中一共展示了ParlDB::display_total_duration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ParlDB

    ?>
</a></li>
                                            <?php 
}
?>
                                        </ul>
                                    </dd>
                                </dl>
                            </div>
                        </div>
                  </div>
            </div>
        <?php 
// DAMN, this really shouldn't be in PAGE.
$db = new ParlDB();
$db->display_total_duration();
$duration = getmicrotime() - STARTTIME;
twfy_debug("TIME", "Total time for page: {$duration} seconds.");
if (!isset($_SERVER['WINDIR'])) {
    $rusage = getrusage();
    $duration = $rusage['ru_utime.tv_sec'] * 1000000 + $rusage['ru_utime.tv_usec'] - STARTTIMEU;
    twfy_debug('TIME', "Total user time: {$duration} microseconds.");
    $duration = $rusage['ru_stime.tv_sec'] * 1000000 + $rusage['ru_stime.tv_usec'] - STARTTIMES;
    twfy_debug('TIME', "Total system time: {$duration} microseconds.");
}
?>

</div> <!-- end #footer -->
</div> <!-- end #container -->

<script src="/js/foundation/foundation.js"></script>
开发者ID:vijo,项目名称:theyworkforyou,代码行数:31,代码来源:footer.php

示例2: page_footer


//.........这里部分代码省略.........
                            js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);

                            return window.twttr || (t = { _e: [], ready: function (f) { t._e.push(f) } });
                        }(document, "script", "twitter-wjs"));

                        // Used with the Google Analytics Tweet tracking
                        function extractParamFromUri(uri, paramName) {
                            if (!uri) {
                                return;
                            }
                            var uri = uri.split('#')[0];  // Remove anchor.
                            var parts = uri.split('?');  // Check for query params.
                            if (parts.length == 1) {
                                return;
                            }
                            var query = decodeURI(parts[1]);

                            // Find url param.
                            paramName += '=';
                            var params = query.split('&');
                            for (var i = 0, param; param = params[i]; ++i) {
                                if (param.indexOf(paramName) === 0) {
                                    return unescape(param.split('=')[1]);
                                }
                            }
                        }

                        function trackTwitter(intent_event) {
                            if (intent_event) {
                                var opt_pagePath;
                                if (intent_event.target && intent_event.target.nodeName == 'IFRAME') {
                                    opt_target = extractParamFromUri(intent_event.target.src, 'url');
                                }
                                ga('send', 'social', 'twitter', 'follow', opt_pagePath);
                            }
                        }

                        twttr.ready(function (twttr) {
                            twttr.events.bind('follow', trackTwitter);
                        });

                    </script>

                      <h5>Donate</h5>
                      <p>
                          This website is run by <a href="http://www.mysociety.org/">mySociety</a>, the project of
                          a <a href="http://www.ukcod.org.uk/">registered charity</a>.
                  If you find it useful, please <a href="http://www.mysociety.org/donate/">donate</a> to keep it running.
                      </p>
                      <h5>Sign up to our newsletter</h5>
                        <form method="post" action="//mysociety.us9.list-manage.com/subscribe/post?u=53d0d2026dea615ed488a8834&id=287dc28511">
                          <input type="email" placeholder="Your email address" name="EMAIL"/>
                          <label style="position: absolute; left: -5000px;">
                              Leave this box empty: <input type="text" name="b_53d0d2026dea615ed488a8834_287dc28511" tabindex="-1" value="" />
                          </label>
                          <input type="submit" value="Subscribe" name="subscribe"/>
                      </form>
                      <p>
                          Approximately once a month, spam free.
                      </p>
                  </div>
        <?php 
        // DAMN, this really shouldn't be in PAGE.
        $db = new ParlDB();
        $db->display_total_duration();
        $duration = getmicrotime() - STARTTIME;
        twfy_debug("TIME", "Total time for page: {$duration} seconds.");
        if (!isset($_SERVER['WINDIR'])) {
            $rusage = getrusage();
            $duration = $rusage['ru_utime.tv_sec'] * 1000000 + $rusage['ru_utime.tv_usec'] - STARTTIMEU;
            twfy_debug('TIME', "Total user time: {$duration} microseconds.");
            $duration = $rusage['ru_stime.tv_sec'] * 1000000 + $rusage['ru_stime.tv_usec'] - STARTTIMES;
            twfy_debug('TIME', "Total system time: {$duration} microseconds.");
        }
        ?>

</div> <!-- end #footer -->
</div> <!-- end #container -->

<script src="/js/riveted.min.js"></script>
<script src="/js/jquery.scrolldepth.min.js"></script>

<script type="text/javascript" charset="utf-8">
    barSetup();
    riveted.init();
    $(function() {
    $.scrollDepth();
    setTimeout(function() {
      try {
        ga('send', 'event', 'engagement', 'timer', '7');
      } catch(err){}
    }, 7000);
  });
</script>

</body>
</html>
<?php 
        ob_end_flush();
    }
开发者ID:udp12,项目名称:theyworkforyou,代码行数:101,代码来源:page.php

示例3: urlencode

    function page_footer($extra = null)
    {
        global $DATA, $this_page;
        // This makes the tracker appear on all sections, but only actually on openaustralia.org
        //if ($DATA->page_metadata($this_page, 'track') ) {
        if (substr(DOMAIN, -18) == "openaustralia.org" && substr(DOMAIN, 0, 7) != "staging") {
            // We want to track this page.
            // Kind of fake URLs needed for the tracker.
            $url = urlencode('http://' . DOMAIN . '/' . $this_page);
            ?>
<script type="text/javascript"><!--
an=navigator.appName;sr='http://x3.extreme-dm.com/';srw="na";srb="na";d=document;r=41;function pr(n) {
d.write("<div><img alt=\"\" src=\""+sr+"n\/?tag=fawkes&p=<?php 
            echo $url;
            ?>
&j=y&srw="+srw+"&srb="+srb+"&l="+escape(d.referrer)+"&rs="+r+"\" height=\"1\" width=\"1\"></"+"div>");}
s=screen;srw=s.width;an!="Netscape"?srb=s.colorDepth:srb=s.pixelDepth
pr()//-->
</script><noscript><div><img alt="" src="http://x3.extreme-dm.com/z/?tag=fawkes&amp;p=<?php 
            echo $url;
            ?>
&amp;j=n" height="1" width="1"></div></noscript>
<?php 
            if (get_http_var('c4') || get_http_var('c4x')) {
                ?>
<script type="text/javascript" src="http://www.channel4.com/media/scripts/statstag.js"></script> <!--//end WEB STATS --> <noscript><div style="display:none"><img width="1" height="1" src="http://stats.channel4.com/njs.gif?dcsuri=/nojavascript&amp;WT.js=No" alt=""></div></noscript>
<?php 
            }
            // mySociety tracking, not on staging
            if (defined('OPTION_TRACKING') && OPTION_TRACKING) {
                track_event($extra);
            }
        }
        // DAMN, this really shouldn't be in PAGE.
        $db = new ParlDB();
        $db->display_total_duration();
        $duration = getmicrotime() - STARTTIME;
        twfy_debug("TIME", "Total time for page: {$duration} seconds.");
        if (!isset($_SERVER['WINDIR'])) {
            $rusage = getrusage();
            $duration = $rusage['ru_utime.tv_sec'] * 1000000 + $rusage['ru_utime.tv_usec'] - STARTTIMEU;
            twfy_debug('TIME', "Total user time: {$duration} microseconds.");
            $duration = $rusage['ru_stime.tv_sec'] * 1000000 + $rusage['ru_stime.tv_usec'] - STARTTIMES;
            twfy_debug('TIME', "Total system time: {$duration} microseconds.");
        }
        ?>
</div> <!-- end #container -->

</body>
</html>
<?php 
        ob_end_flush();
    }
开发者ID:archoo,项目名称:twfy,代码行数:53,代码来源:page.php

示例4: isset


//.........这里部分代码省略.........
                            </ul>
                        </dd>                
                        <dt>Technical: </dt>
        			    <dd>
        			        <ul>
                			    <?php 
        foreach ($tech_links as $tech_link) {
            echo '<li>' . $tech_link . '</li>';
        }
        ?>
                            </ul>
                        </dd>
        		  </dl>
        		  <div>
        		      <h5>Donate</h5>
        		      <p>
        		          This website is run by <a href="http://www.mysociety.org/">mySociety</a>, the project of a
                          a <a href="http://www.ukcod.org.uk/">registered charity</a>.
				  If you find it useful, please <a href="http://www.mysociety.org/donate/">donate</a> to keep it running.
        		      </p>
        		      <h5>Sign up to our newsletter</h5>
        		      <form method="get" action="https://secure.mysociety.org/admin/lists/mailman/subscribe/news">
        		          <input type="text" name="email">
        		          <input type="submit" value="Join">
        		      </form>
        		      <p>
        		          Approximately once a month, spam free.
        		      </p>
        		  </div>
        <?php 
        // This makes the tracker appear on all sections, but only actually on theyworkforyou.com
        //if ($DATA->page_metadata($this_page, 'track') ) {
        if (DOMAIN == 'www.theyworkforyou.com') {
            // We want to track this page.
            // Kind of fake URLs needed for the tracker.
            $url = urlencode('http://' . DOMAIN . '/' . $this_page);
            ?>
<script type="text/javascript"><!--
an=navigator.appName;sr='http://x3.extreme-dm.com/';srw="na";srb="na";d=document;r=41;function pr(n) {
d.write("<img alt='' src=\""+sr+"n\/?tag=fawkes&p=<?php 
            echo $url;
            ?>
&j=y&srw="+srw+"&srb="+srb+"&l="+escape(d.referrer)+"&rs="+r+"\" height='1' width='1'>");}
s=screen;srw=s.width;an!="Netscape"?srb=s.colorDepth:srb=s.pixelDepth
pr()//-->
</script><noscript><img alt="" src="http://x3.extreme-dm.com/z/?tag=fawkes&amp;p=<?php 
            echo $url;
            ?>
&amp;j=n" height="1" width="1"></noscript>
<?php 
            // mySociety tracking, not on staging
            if (defined('OPTION_TRACKING') && OPTION_TRACKING) {
                track_event($extra);
            }
        }
        // DAMN, this really shouldn't be in PAGE.
        $db = new ParlDB();
        $db->display_total_duration();
        $duration = getmicrotime() - STARTTIME;
        twfy_debug("TIME", "Total time for page: {$duration} seconds.");
        if (!isset($_SERVER['WINDIR'])) {
            $rusage = getrusage();
            $duration = $rusage['ru_utime.tv_sec'] * 1000000 + $rusage['ru_utime.tv_usec'] - STARTTIMEU;
            twfy_debug('TIME', "Total user time: {$duration} microseconds.");
            $duration = $rusage['ru_stime.tv_sec'] * 1000000 + $rusage['ru_stime.tv_usec'] - STARTTIMES;
            twfy_debug('TIME', "Total system time: {$duration} microseconds.");
        }
        if (DOMAIN == 'www.theyworkforyou.com') {
            ?>
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://piwik.mysociety.org/" : "http://piwik.mysociety.org/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
<!--
piwik_action_name = '';
piwik_idsite = 7;
piwik_url = pkBaseURL + "piwik.php";
piwik_log(piwik_action_name, piwik_idsite, piwik_url);
//-->
</script>
<noscript><img src="http://piwik.mysociety.org/piwik.php?idsite=7" width=1 height=1 style="border:0" alt=""></noscript>
<!-- /Piwik -->
<?php 
        }
        ?>

<br class="clear">
</div> <!-- end #footer -->
</div> <!-- end #container -->

<script type="text/javascript" charset="utf-8">
    barSetup();
</script>
</body>
</html>
<?php 
        ob_end_flush();
    }
开发者ID:sebbacon,项目名称:theyworkforyou,代码行数:101,代码来源:page.php


注:本文中的ParlDB::display_total_duration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。