當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DateTimeUtil::Get_Elapsed_Time方法代碼示例

本文整理匯總了PHP中DateTimeUtil::Get_Elapsed_Time方法的典型用法代碼示例。如果您正苦於以下問題:PHP DateTimeUtil::Get_Elapsed_Time方法的具體用法?PHP DateTimeUtil::Get_Elapsed_Time怎麽用?PHP DateTimeUtil::Get_Elapsed_Time使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DateTimeUtil的用法示例。


在下文中一共展示了DateTimeUtil::Get_Elapsed_Time方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: unset

 $view->assign('graph_stored_files', $graph->Render());
 unset($graph);
 // Get last 10 jobs list
 $query = "SELECT JobId, Level, JobFiles, JobBytes, ReadBytes, JobStatus, StartTime, EndTime, Name ";
 $query .= "FROM Job ";
 $query .= "WHERE Name = '{$backupjob_name}' ";
 $query .= "ORDER BY EndTime DESC ";
 $query .= "LIMIT 7 ";
 $jobs = array();
 $joblevel = array('I' => 'Incr', 'D' => 'Diff', 'F' => 'Full');
 $result = CDBUtils::runQuery($query, $dbSql->db_link);
 foreach ($result->fetchAll() as $job) {
     // Job level description
     $job['joblevel'] = $joblevel[$job['level']];
     // Job execution execution time
     $job['elapsedtime'] = DateTimeUtil::Get_Elapsed_Time($job['starttime'], $job['endtime']);
     // Compression
     if ($job['jobbytes'] > 0) {
         $compression = 1 - $job['jobbytes'] / $job['readbytes'];
         $job['compression'] = number_format($compression, 2);
     } else {
         $job['compression'] = 'N/A';
     }
     // Job speed
     $start = $job['starttime'];
     $end = $job['endtime'];
     $seconds = DateTimeUtil::get_ElaspedSeconds($end, $start);
     if ($seconds !== false && $seconds > 0) {
         $speed = $job['jobbytes'] / $seconds;
         $job['speed'] = CUtils::Get_Human_Size($speed, 2) . '/s';
     } else {
開發者ID:ektich,項目名稱:bacula-web,代碼行數:31,代碼來源:backupjob-report.php

示例2: switch

     case J_NOT_RUNNING:
         $job['Job_icon'] = "time";
         break;
 }
 // end switch
 // Job start time, end time and elapsed time
 $start_time = $job['starttime'];
 $end_time = $job['endtime'];
 if ($start_time == '0000-00-00 00:00:00' or is_null($start_time) or $start_time == 0) {
     $job['starttime'] = 'n/a';
 }
 if ($end_time == '0000-00-00 00:00:00' or is_null($end_time) or $end_time == 0) {
     $job['endtime'] = 'n/a';
 }
 // Get the job elapsed time completion
 $job['elapsed_time'] = DateTimeUtil::Get_Elapsed_Time($start_time, $end_time);
 // Job Level
 $job['level'] = $job_levels[$job['level']];
 // Job files
 $job['jobfiles'] = CUtils::format_Number($job['jobfiles']);
 // Set default Job speed and compression rate
 $job['speed'] = '0 Mb/s';
 $job['compression'] = 'n/a';
 switch ($job['jobstatus']) {
     case J_COMPLETED:
     case J_COMPLETED_ERROR:
     case J_NO_FATAL_ERROR:
     case J_CANCELED:
         // Job speed
         $seconds = DateTimeUtil::get_ElaspedSeconds($end_time, $start_time);
         if ($seconds !== false && $seconds > 0) {
開發者ID:ektich,項目名稱:bacula-web,代碼行數:31,代碼來源:jobs.php


注:本文中的DateTimeUtil::Get_Elapsed_Time方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。