1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/doc/en/tmr_ref.html

122 lines
4.5 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Language" content="en-us">
<title>Product</title><link rel="stylesheet" type="text/css" href="./style.css"></head>
<body bgcolor="#ffffff">
<h3><a name="over"></a>tmr</h3><span style="font-weight: bold;"></span><big><br></big><p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">It allows Lua to execute timer specific operations (delay, read timer value,</font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">start timer, get time difference).</font>
</p>
<p style="margin-bottom: 0in;">
<br>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif"><a name="delay"></a>tmr.delay( id, delay ): uses timer 'id' to wait for 'delay' us.</font>
</p>
<p style="margin-bottom: 0in;">
<br>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif"><span style="font-style: italic;"><a name="read"></a></span>Data = tmr.read( id ): reads the value of timer 'id'. The returned value is </font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">platform dependent.</font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif"><span style="font-style: italic;"><a name="start"></a></span>Data = tmr.start( id ): start the timer 'id', and also returns its value at</font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">the moment of start. The returned value is platform dependent.</font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif"><a name="diff"></a>diff = tmr.diff( id, end, start ): returns the time difference (in us) between</font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">the timer values 'end' and 'start' (obtained from calling tmr.start or</font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">tmr.read). The order of end/start is irrelevant. </font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif"><a name="mindelay"></a>Data = tmr.mindelay( id ): returns the minimum delay (in us ) that can be </font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">achieved by calling the tmr.delay function. If the return value is 0, the </font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">platform layer is capable of executing sub-microsecond delays.</font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif"><a name="maxdelay"></a>Data = tmr.maxdelay( id ): returns the maximum delay (in us) that can be</font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">achieved by calling the tmr.delay function.</font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif"><a name="setclock"></a>Data = tmr.setclock( id, clock ): sets the clock of the given timer. Returns the</font>
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif">actual clock set for the timer.</font>
</p>
<p style="margin-bottom: 0in;">
</p>
<p style="margin-bottom: 0in;">
<font face="Bitstream Vera Sans Mono, sans-serif"><a name="getclock"></a>Data = tmr.getclock( id ): return the clock of the given timer.</font>
</p>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<p style="margin-bottom: 0in;">
<br>
</p><big><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br style="font-family: Helvetica,Arial,sans-serif;"><font style="font-family: Helvetica,Arial,sans-serif;" size="2"><big>
</big></font><br style="font-family: Helvetica,Arial,sans-serif;"><font style="font-family: Helvetica,Arial,sans-serif;" size="2"><big>
</big></font><br style="font-family: Helvetica,Arial,sans-serif;"><span style="font-family: Helvetica,Arial,sans-serif;">
&nbsp;
</span></big>
<br>
<br style="font-family: Verdana;"></body></html>