本文整理汇总了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 {
示例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) {