ludic/ns-duration.html
2026-09-17 22:10:03 +00:00

22 lines
No EOL
3.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 &gt; 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) -&gt; 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) -&gt; 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) -&gt; 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) -&gt; 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) -&gt; 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) -&gt; 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) -&gt; 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) -&gt; 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>