[doc] realtime() page improved
[scilab.git] / scilab / modules / time / help / ja_JP / realtime.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) INRIA -
5  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2018 - Samuel GOUGEON
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
18           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
19           xml:lang="ja" xml:id="realtime">
20     <refnamediv xml:id="realtimeinit">
21         <refname>realtimeinit</refname>
22         <refpurpose>時間の単位を設定</refpurpose>
23     </refnamediv>
24     <refnamediv>
25         <refname>realtime</refname>
26         <refpurpose>日付の原点を設定または指定日付まで待つ</refpurpose>
27     </refnamediv>
28     <refsynopsisdiv>
29         <title>呼び出し手順</title>
30         <synopsis>
31             realtimeinit(time_unit)
32             realtime(t0)
33             realtime(t)
34         </synopsis>
35     </refsynopsisdiv>
36     <refsection>
37         <title>パラメータ</title>
38         <variablelist>
39             <varlistentry>
40                 <term>time_unit</term>
41                 <listitem>
42                     <para>
43                         実数. <literal>realtime</literal> の引数に関連する秒数
44                     </para>
45                 </listitem>
46             </varlistentry>
47             <varlistentry>
48                 <term>t0</term>
49                 <listitem>
50                     <para>
51                        decimal number: initial datetime, in <literal>time_unit</literal>.
52                        This meaning holds when <literal>realtime(…)</literal> is called for the
53                        first time after the last <literal>realtimeinit(…)</literal>.
54                        This first call sets the datetime origin and restarts the real timer.
55                     </para>
56                 </listitem>
57             </varlistentry>
58             <varlistentry>
59                 <term>t</term>
60                 <listitem>
61                     <para>実数.  日付</para>
62                 </listitem>
63             </varlistentry>
64         </variablelist>
65     </refsection>
66     <refsection>
67         <title>説明</title>
68         <para>
69             これら2つの関数はScilabで実時間を処理する際に使用できます.
70         </para>
71         <para>
72             <literal>realtimeinit(time_unit)</literal>  は,
73             <literal>realtime</literal> の引数 <literal>t</literal>に
74             関する時間の単位を定義します.
75         </para>
76         <para>
77             <literal>realtime(t0)</literal>を最初にコールした際,
78             カレントの日付が<literal>t0</literal>に設定されます.
79             これ以降のコール<literal>realtime(t)</literal>では,
80             日付<literal>t</literal>に達するまで待機します.
81         </para>
82     </refsection>
83     <refsection>
84         <title>例</title>
85         <para>
86         In the following example, in a loop, a job takes an arbitrary time, from
87         0 to 1.50 s. This is simulated with a sleep() of random duration. Although this period
88         is not regular, realtime() is used to compensate and print something every 2.00 seconds:
89         </para>
90         <programlisting role="example"><![CDATA[
91 clc
92 tic();
93 realtimeinit(2.00);
94 realtime(0);
95 for k = 1:10
96     if k==1, mprintf("\nSleep for  Wake-up at   Wait until date\n"), end
97     d = rand(1,1);
98     sleep(d*1500);
99     mprintf(' %4.2f s     %5.2f s', d*1.5, toc());
100     realtime(k);
101     mprintf('      %5.2f s\n', toc());
102 end
103  ]]></programlisting>
104     <screen><![CDATA[
105 Sleep for  Wake-up at   Wait until date
106  0.28 s      0.57 s       2.08 s
107  0.03 s      2.11 s       4.08 s
108  1.27 s      5.34 s       6.08 s
109  0.11 s      6.19 s       8.08 s
110  1.28 s      9.36 s      10.08 s
111  0.02 s     10.10 s      12.08 s
112  0.28 s     12.36 s      14.08 s
113  0.74 s     14.82 s      16.08 s
114  1.12 s     17.20 s      18.08 s
115  1.41 s     19.49 s      20.08 s
116 ]]></screen>
117     </refsection>
118     <refsection role="see also">
119         <title>参照</title>
120         <simplelist type="inline">
121             <member>
122                 <link linkend="sleep">sleep</link>
123             </member>
124             <member>
125                 <link linkend="getdate">getdate</link>
126             </member>
127             <member>
128                 <link linkend="waitbar">waitbar</link>
129             </member>
130             <member>
131                 <link linkend="progressionbar">progressionbar</link>
132             </member>
133         </simplelist>
134     </refsection>
135 </refentry>