| 1 |
<?php |
| 2 |
/** |
| 3 |
* This file is part of the ramsey/uuid library |
| 4 |
* |
| 5 |
* For the full copyright and license information, please view the LICENSE |
| 6 |
* file that was distributed with this source code. |
| 7 |
* |
| 8 |
* @copyright Copyright (c) Ben Ramsey <[email protected]> |
| 9 |
* @license http://opensource.org/licenses/MIT MIT |
| 10 |
* @link https://benramsey.com/projects/ramsey-uuid/ Documentation |
| 11 |
* @link https://packagist.org/packages/ramsey/uuid Packagist |
| 12 |
* @link https://github.com/ramsey/uuid GitHub |
| 13 |
*/ |
| 14 |
|
| 15 |
namespace Ramsey\Uuid\Provider\Time; |
| 16 |
|
| 17 |
use Ramsey\Uuid\Provider\TimeProviderInterface; |
| 18 |
|
| 19 |
/** |
| 20 |
* SystemTimeProvider uses built-in PHP functions to provide the time |
| 21 |
*/ |
| 22 |
class SystemTimeProvider implements TimeProviderInterface |
| 23 |
{ |
| 24 |
/** |
| 25 |
* Returns a timestamp array |
| 26 |
* |
| 27 |
* @return int[] Array containing `sec` and `usec` components of a timestamp |
| 28 |
*/ |
| 29 |
public function currentTime() |
| 30 |
{ |
| 31 |
return gettimeofday(); |
| 32 |
} |
| 33 |
} |