cvs: phpdoc-ro /reference/datetime/functions microtime.xml
| From: | Simion Onea | Date: | Sat, 24 May 2008 09:42:44 +0000 |
| Subject: | cvs: phpdoc-ro /reference/datetime/functions microtime.xml | ||
| Groups: | php.doc.ro | ||
| Request: | Send a blank email to doc-ro+get-450@lists.php.net to get a copy of this message | ||
simionea Sat May 24 09:42:44 2008 UTC
Modified files:
/phpdoc-ro/reference/datetime/functions microtime.xml
Log:
Updated the file.
http://cvs.php.net/viewvc.cgi/phpdoc-ro/reference/datetime/functions/microtime.xml?r1=1.3&r2=1.4&diff_format=u
Index: phpdoc-ro/reference/datetime/functions/microtime.xml
diff -u phpdoc-ro/reference/datetime/functions/microtime.xml:1.3
phpdoc-ro/reference/datetime/functions/microtime.xml:1.4
--- phpdoc-ro/reference/datetime/functions/microtime.xml:1.3 Tue Sep 18 13:46:29 2007
+++ phpdoc-ro/reference/datetime/functions/microtime.xml Sat May 24 09:42:44 2008
@@ -1,51 +1,134 @@
-<?xml version="1.0" encoding="iso-8859-2"?>
-<!-- EN-Revision: 1.0 Maintainer: adiju Status: outdated -->
-<!-- splitted from ./ro/functions/datetime.xml, last change in rev 1.1 -->
-<!-- last change to 'microtime' in en/ tree in rev 1.2 -->
- <refentry xml:id="function.microtime" xmlns="http://docbook.org/ns/docbook">
- <refnamediv>
- <refname>microtime</refname>
- <refpurpose>Returneazã timestamp-ul curent UNIX cu microsecunde</refpurpose>
- </refnamediv>
- <refsect1>
- <title>Descriere</title>
- <methodsynopsis>
- <type>string</type><methodname>microtime</methodname>
- <void/>
- </methodsynopsis>
- <para>
- Returneazã ºirul "msec sec" unde sec este timpul curent mãsurat în secunde de la
începutul Epocii UNIX (0:00:00 January 1, 1970 GMT), ºi msec este partea reprezentând
microsecndele. Aceastã funcþie este valabilã pe sistemele de operare care suportã apelul sistem
gettimeofday().
- </para>
- <para>
- Ambele pãrþi ale ºirului sunt returnate în unitãþi de secunde.
- <example>
- <title>Exemplu <function>microtime</function></title>
- <programlisting role="php">
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision: 1.4 $ -->
+<!-- EN-Revision: 1.15 Maintainer: simionea Status: translated -->
+<!-- CREDITS: adiju -->
+<refentry xml:id="function.microtime" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+ <refname>microtime</refname>
+ <refpurpose>Ãntoarce timpul curent Unix cu microsecunde</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+ &reftitle.description;
+ <methodsynopsis>
+ <type>mixed</type><methodname>microtime</methodname>
+ <methodparam
choice="opt"><type>bool</type><parameter>get_as_float</parameter></methodparam>
+ </methodsynopsis>
+ <para>
+ <function>microtime</function> întoarce timpul curent Unix cu microsecunde.
+ AceastÄ funcÅ£ie este disponibilÄ numai pe sistemele de operare ce susÅ£in
+ apelul de sistem gettimeofday().
+ </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+ &reftitle.parameters;
+ <para>
+ <variablelist>
+ <varlistentry>
+ <term><parameter>get_as_float</parameter></term>
+ <listitem>
+ <para>
+ Când este apelatÄ fÄrÄ parametrul opÅ£ional, aceastÄ funcÅ£ie întoarce
+ string-ul "msec sec", unde sec este timpul curent mÄsurat în numÄrul
+ de secunde de la Epoca Unix (0:00:00 January 1, 1970 GMT) Åi msec este
+ partea cu microsecunde. Ambele porţiuni ale string-ului sunt întoarse
+ în unitÄÅ£i de secunde.
+ </para>
+ <para>
+ DacÄ parametrul opÅ£ional <parameter>get_as_float</parameter> este
+ stabilit în &true;, atunci este întors un <type>float</type> (în
secunde).
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ </refsect1>
+
+ <refsect1 role="changelog">
+ &reftitle.changelog;
+ <para>
+ <informaltable>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>&Version;</entry>
+ <entry>&Description;</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>5.0.0</entry>
+ <entry>
+ A fost adÄugat parametrul <parameter>get_as_float</parameter>.
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title>MÄsurarea timpului de execuÅ£ie a script-ului cu ajutorul
<function>microtime</function></title>
+ <programlisting role="php">
<![CDATA[
-function getmicrotime(){
- list($usec, $sec) = explode(" ",microtime());
+<?php
+/**
+ * O funcÅ£ie simplÄ pentru a copia comportamentul PHP 5
+ */
+function microtime_float()
+{
+ list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
- }
+}
+
+$time_start = microtime_float();
-$start_t = getmicrotime();
-
-for ($i=0; $i < 1000; $i++){
- //do nothing, 1000 times
- }
+// OpreÅte execuÅ£ia un pic
+usleep(100);
-$stop_t = getmicrotime();
-$timp = $stop_t - $start_t;
+$time_end = microtime_float();
+$time = $time_end - $time_start;
-echo "N-am facut nimic timp de $time secunde";
+echo "Nu am fÄcut nimic timp de $time secunde\n";
+?>
]]>
- </programlisting>
- </example>
- </para>
- <para>
- Vezi, de asemenea, <function>time</function>.
- </para>
- </refsect1>
- </refentry>
+ </programlisting>
+ </example>
+ <example>
+ <title>MÄsurarea timpului de execuÅ£ie a script-ului în PHP 5</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+$time_start = microtime(true);
+
+// OpreÅte execuÅ£ia un pic
+usleep(100);
+
+$time_end = microtime(true);
+$time = $time_end - $time_start;
+
+echo "Nu am fÄcut nimic timp de $time secunde\n";
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+ &reftitle.seealso;
+ <para>
+ <simplelist>
+ <member><function>time</function></member>
+ </simplelist>
+ </para>
+ </refsect1>
+</refentry>
<!-- Keep this comment at the end of the file
Local variables: