PHP Classes

File: ext/kernel/time.c

Recommend this page to a friend!
  Classes of Andrew Collington  >  iWire PHP Raspberry PI GPIO Class  >  ext/kernel/time.c  >  Download  
File: ext/kernel/time.c
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: iWire PHP Raspberry PI GPIO Class
Control a Raspberry PI board using GPIO
Author: By
Last change:
Date: 4 years ago
Size: 1,713 bytes


Class file image Download
 | Zephir Language                                                        |
 | Copyright (c) 2011-2015 Zephir Team  (      |
 | This source file is subject to the New BSD License that is bundled     |
 | with this package in the file docs/LICENSE.txt.                        |
 |                                                                        |
 | If you did not receive a copy of the license and are unable to         |
 | obtain it through the world-wide-web, please send an email             |
 | to so we can send you a copy immediately.      |

#include "config.h"

#ifdef PHP_WIN32
#include "win32/time.h"
#elif defined(NETWARE)
#include <sys/timeval.h>
#include <sys/time.h>
#include <sys/time.h>

#include <ctype.h>

#include "php.h"
#include "php_ext.h"

#include "kernel/main.h"
#include "kernel/time.h"
#include "kernel/operators.h"

void zephir_time(zval *return_value)

void zephir_microtime(zval *return_value, zval *get_as_float TSRMLS_DC)
	struct timeval tp = {0};
	char ret[100];

	if (gettimeofday(&tp, NULL)) {

	if (get_as_float && ZEPHIR_IS_TRUE(get_as_float)) {
		RETURN_DOUBLE((double)(tp.tv_sec + tp.tv_usec / MICRO_IN_SEC));

	snprintf(ret, 100, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec);
For more information send a message to info at phpclasses dot org.