22 lines
No EOL
3.1 KiB
HTML
22 lines
No EOL
3.1 KiB
HTML
<!doctype html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Duration — Ludic</title>
|
||
<meta name="description" content="Spans of real time, measured in whole seconds and carried in a plain int — so a duration adds, subtracts and compares with the ordinary operators…">
|
||
<link rel="stylesheet" href="base.css">
|
||
<link rel="stylesheet" href="docs.css">
|
||
</head>
|
||
<body>
|
||
<header class="nav"><div class="wrap nav-in"><a class="brand" href="index.html"><span class="logo">L</span> Ludic</a><button class="nav-toggle" aria-label="Toggle menu" aria-expanded="false">☰</button><nav class="nav-links"><a href="index.html">Home</a><a href="api.html">API Reference</a><a class="nav-cta" href="https://git.workshopsoft.io/workshopsoft/ludic">Source ↗</a></nav></div></header>
|
||
<main class="wrap item">
|
||
<div class="crumbs"><a href="api.html">API Reference</a> <span>›</span> <span class="here">Duration</span></div>
|
||
<div class="item-head"><span class="kind-badge kind-namespace">namespace</span><h1 id="top">Duration</h1></div>
|
||
<p class="ns-blurb">Spans of real time, measured in whole seconds and carried in a plain <code>int</code> — so a duration adds, subtracts and compares with the ordinary operators (<code>Duration.minutes(5) + Duration.seconds(30)</code>, <code>away > Duration.hours(3)</code>). The constructors build a span from a unit; the <code>as_*</code> readers convert a span back to whole units (truncating toward zero). Integer-only, so no floating-point drift.</p>
|
||
<div class="ns-methods"><a class="ns-method" href="duration-seconds.html"><code class="nm-sig">Duration.seconds(n) -> int</code><span class="nm-tip">A span of n whole seconds.</span></a><a class="ns-method" href="duration-minutes.html"><code class="nm-sig">Duration.minutes(n) -> int</code><span class="nm-tip">A span of n minutes, in seconds.</span></a><a class="ns-method" href="duration-hours.html"><code class="nm-sig">Duration.hours(n) -> int</code><span class="nm-tip">A span of n hours, in seconds.</span></a><a class="ns-method" href="duration-days.html"><code class="nm-sig">Duration.days(n) -> int</code><span class="nm-tip">A span of n days, in seconds.</span></a><a class="ns-method" href="duration-as_seconds.html"><code class="nm-sig">Duration.as_seconds(span) -> int</code><span class="nm-tip">The span in whole seconds.</span></a><a class="ns-method" href="duration-as_minutes.html"><code class="nm-sig">Duration.as_minutes(span) -> int</code><span class="nm-tip">The span in whole minutes.</span></a><a class="ns-method" href="duration-as_hours.html"><code class="nm-sig">Duration.as_hours(span) -> int</code><span class="nm-tip">The span in whole hours.</span></a><a class="ns-method" href="duration-as_days.html"><code class="nm-sig">Duration.as_days(span) -> int</code><span class="nm-tip">The span in whole days.</span></a></div>
|
||
<a class="back" href="api.html">← All symbols</a>
|
||
</main>
|
||
<script src="ludic-highlight.js"></script>
|
||
<script>Ludic.installCards(); Ludic.flashTarget();</script>
|
||
</body></html> |