Files
gbdk-2020/docs/api/time_8h.html
2025-12-27 17:53:11 -08:00

225 lines
11 KiB
HTML

<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/time.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
<!-- BEGIN: doxygen-awesome-css -->
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript">
DoxygenAwesomeParagraphLink.init()
</script>
<!-- END: doxygen-awesome-css -->
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GBDK 2020 Docs
&#160;<span id="projectnumber">4.5.0</span>
</div>
<div id="projectbrief">API Documentation for GBDK 2020</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('time_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">time.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;<a class="el" href="types_8h_source.html">types.h</a>&gt;</code><br />
<code>#include &lt;<a class="el" href="stdint_8h_source.html">stdint.h</a>&gt;</code><br />
</div>
<p><a href="time_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:CLOCKS_PER_SEC"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="time_8h.html#CLOCKS_PER_SEC">CLOCKS_PER_SEC</a>&#160;&#160;&#160;60</td></tr>
<tr class="separator:CLOCKS_PER_SEC"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:time_t"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="stdint_8h.html#uint16_t">uint16_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="time_8h.html#time_t">time_t</a></td></tr>
<tr class="separator:time_t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:clock"><td class="memItemLeft" align="right" valign="top"><a class="el" href="asm_2mos6502_2types_8h.html#clock_t">clock_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="time_8h.html#clock">clock</a> (void) <a class="el" href="asm_2types_8h.html#OLDCALL">OLDCALL</a></td></tr>
<tr class="separator:clock"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:time"><td class="memItemLeft" align="right" valign="top"><a class="el" href="time_8h.html#time_t">time_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="time_8h.html#time">time</a> (<a class="el" href="time_8h.html#time_t">time_t</a> *t)</td></tr>
<tr class="separator:time"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Sort of ANSI compliant time functions. </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="CLOCKS_PER_SEC" name="CLOCKS_PER_SEC"></a>
<h2 class="memtitle"><span class="permalink"><a href="#CLOCKS_PER_SEC">&#9670;&nbsp;</a></span>CLOCKS_PER_SEC</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CLOCKS_PER_SEC&#160;&#160;&#160;60</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="time_t" name="time_t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#time_t">&#9670;&nbsp;</a></span>time_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="stdint_8h.html#uint16_t">uint16_t</a> <a class="el" href="time_8h.html#time_t">time_t</a></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="clock" name="clock"></a>
<h2 class="memtitle"><span class="permalink"><a href="#clock">&#9670;&nbsp;</a></span>clock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="asm_2mos6502_2types_8h.html#clock_t">clock_t</a> clock </td>
<td>(</td>
<td class="paramtype">void&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Returns an approximation of processor time used by the program in Clocks</p>
<p >The value returned is the CPU time (ticks) used so far as a <a class="el" href="asm_2z80_2types_8h.html#clock_t">clock_t</a>.</p>
<p >To get the number of seconds used, divide by <a class="el" href="time_8h.html#CLOCKS_PER_SEC">CLOCKS_PER_SEC</a>.</p>
<p >This is based on <a class="el" href="sms_8h.html#sys_time">sys_time</a>, which will wrap around every ~18 minutes. (unsigned 16 bits = 65535 / 60 / 60 = 18.2)</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="sms_8h.html#sys_time">sys_time</a>, <a class="el" href="time_8h.html#time">time()</a> </dd></dl>
</div>
</div>
<a id="time" name="time"></a>
<h2 class="memtitle"><span class="permalink"><a href="#time">&#9670;&nbsp;</a></span>time()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="time_8h.html#time_t">time_t</a> time </td>
<td>(</td>
<td class="paramtype"><a class="el" href="time_8h.html#time_t">time_t</a> *&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Converts <a class="el" href="time_8h.html#clock">clock()</a> time to Seconds</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">t</td><td>If pointer <b>t</b> is not NULL, it's value will be set to the same seconds calculation as returned by the function.</td></tr>
</table>
</dd>
</dl>
<p>The calculation is <a class="el" href="time_8h.html#clock">clock()</a> / CLOCKS_PER_SEC</p>
<p >Returns: time in seconds </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="sms_8h.html#sys_time">sys_time</a>, <a class="el" href="time_8h.html#clock">clock()</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_8bd3092e915ccc8a773a74e0a10d4d15.html">gbdk-lib</a></li><li class="navelem"><a class="el" href="dir_a9f896cff747ba031115e41245385c17.html">include</a></li><li class="navelem"><a class="el" href="time_8h.html">time.h</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2 </li>
</ul>
</div>
</body>
</html>