This repository has been archived on 2024-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
epubreader/lib/Utility/Time.php

30 lines
515 B
PHP
Raw Permalink Normal View History

2020-04-21 20:37:42 +00:00
<?php
/**
* @author Frank de Lange
* @copyright 2017 Frank de Lange
*
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace OCA\Epubreader\Utility;
2020-04-21 20:37:42 +00:00
2023-08-02 20:04:03 +00:00
class Time
{
public function getTime(): int
{
2023-06-16 14:58:23 +00:00
return time();
}
2020-04-21 20:37:42 +00:00
2023-06-16 14:58:23 +00:00
/**
2023-06-16 19:20:03 +00:00
* @return int the current unix time in miliseconds
2023-06-16 14:58:23 +00:00
*/
2023-08-02 20:04:03 +00:00
public function getMicroTime(): int
{
2023-06-17 22:37:08 +00:00
list($millisecs, $secs) = explode(' ', microtime());
2023-08-02 20:04:03 +00:00
return (int) ($secs.substr($millisecs, 2, 6));
2023-06-16 14:58:23 +00:00
}
}