Sfoglia il codice sorgente

Round 173f: frame probe for --uiperf and LYNX_TRACE_UI, fader drag by mouse

A transparent overlay on the main window sees every painted frame with its dirty area
(JUCE skips the window's own paint() when opaque children cover the region, so the old
'painted frames' count missed most partial repaints). --uiperf now reports per step the
frames per second, frame gaps p50/p95/p99/max, the message thread's and the audio device's
CPU, and has the discussion #10 layout: Channel Rack + Mixer with the pattern playing,
then insert 3's fader dragged by mouse events at 125 Hz (queue delay, input-to-paint
latency, value kept on release). LYNX_TRACE_UI logs frames per second and the longest gap.
Ka1-S 1 mese fa
parent
commit
dc4f7cf72f

+ 199 - 1
src/Main.cpp

@@ -83,6 +83,8 @@
 #include "ui/QuickAddPalette.h"
 #include "ui/I18n.h"
 #include "ui/MainComponent.h"
+#include "ui/FrameProbe.h"
+#include "ui/UiTrace.h"
 #include "core/MixerOps.h"
 #include "ui/QuickPick.h"
 #include "core/NoteTools.h"
@@ -278,6 +280,134 @@ juce::String collectUncleanSessions()
 }
 } // namespace
 
+// --uiperf (round 173f, discussion #10): a mixer fader dragged up and down with the mouse while the pattern plays. A
+// high-resolution timer delivers 125 moves a second to the message thread through the window's own mouse path
+// (ComponentPeer::handleMouseEvent), at most one waiting at a time as Windows does with WM_MOUSEMOVE; every frame the
+// window paints tells whether it covered the fader. Measured: how long a move waited for the message thread, the time
+// from a move to the first frame that shows the fader after it (input → paint), and whether the value stays put when
+// the mouse is released.
+struct UiPerfDrag final : public std::enable_shared_from_this<UiPerfDrag>,
+                          private juce::HighResolutionTimer
+{
+    ~UiPerfDrag() override { stopTimer(); }
+
+    void start (juce::Component& windowIn, juce::Component& strips, juce::Rectangle<int> rail, lynx::AudioEngine* engineIn, int trackIn)
+    {
+        window = &windowIn;
+        engine = engineIn;
+        track = trackIn;
+        railInWindow = window->getLocalArea (&strips, rail);
+        watch = railInWindow.expanded (6, 40); // the cap, its tip above and the dB read-out below
+        visible = strips.isShowing() && window->getLocalArea (&strips, strips.getLocalBounds()).contains (railInWindow.getCentre());
+        const auto volume = engine->getSong().mixer[(std::size_t) track].volume;
+        x = (float) railInWindow.getCentreX();
+        startY = (float) railInWindow.getBottom() - volume * (float) railInWindow.getHeight(); // on the cap: no jump
+        amplitude = 0.4f * (float) railInWindow.getHeight();
+        centreY = juce::jlimit ((float) railInWindow.getY() + amplitude, (float) railInWindow.getBottom() - amplitude, startY);
+        t0 = juce::Time::getMillisecondCounterHiRes();
+        inject (x, startY, false);
+        juce::ModifierKeys::currentModifiers = juce::ModifierKeys (juce::ModifierKeys::leftButtonModifier);
+        inject (x, startY, true);
+        active = true;
+        startTimer (8);
+    }
+
+    // message thread
+    void framePainted (double now, juce::Rectangle<int> area)
+    {
+        if (pending.empty() || ! area.intersects (watch))
+            return;
+        for (const auto t : pending)
+            latencies.push_back (now - t);
+        pending.clear();
+        ++framesOverFader;
+    }
+
+    juce::String stop()
+    {
+        stopTimer();
+        active = false;
+        valueAtRelease = engine->getSong().mixer[(std::size_t) track].volume;
+        juce::ModifierKeys::currentModifiers = {};
+        inject (x, lastY, false);
+        juce::String text;
+        text << "    drag of insert " << track << "'s fader" << (visible ? "" : " (NOT VISIBLE)") << ": " << moves << " moves handled, " << dropped
+             << " folded into the next (the message thread still busy with the previous one)\n"
+             << "    move waited for the message thread: " << describe (queueDelays) << "\n"
+             << "    input -> paint (move to the first frame over the fader): " << describe (latencies) << ", " << framesOverFader
+             << " frames over the fader\n";
+        return text;
+    }
+
+    juce::String released() const
+    {
+        const auto now = engine->getSong().mixer[(std::size_t) track].volume;
+        return "    after the release: fader " + juce::String (now, 4) + " (" + juce::String (valueAtRelease, 4) + " when released) "
+               + (std::abs (now - valueAtRelease) < 1.0e-4f ? "kept" : "CHANGED") + "\n";
+    }
+
+private:
+    juce::Component* window = nullptr;
+    lynx::AudioEngine* engine = nullptr;
+    int track = 1;
+    juce::Rectangle<int> railInWindow, watch;
+    bool visible = false;
+    float x = 0.0f, startY = 0.0f, centreY = 0.0f, amplitude = 0.0f, lastY = 0.0f;
+    double t0 = 0.0;
+    std::atomic<bool> active { false }, posted { false };
+    std::atomic<int> dropped { 0 };
+    int moves = 0, framesOverFader = 0;
+    float valueAtRelease = 0.0f;
+    std::vector<double> pending, latencies, queueDelays;
+
+    static juce::String describe (std::vector<double> v)
+    {
+        if (v.empty())
+            return "none";
+        std::sort (v.begin(), v.end());
+        const auto at = [&v] (double q) { return v[std::min (v.size() - 1, (std::size_t) (q * (double) v.size()))]; };
+        return "p50 " + juce::String (at (0.5), 1) + " / p95 " + juce::String (at (0.95), 1) + " / p99 " + juce::String (at (0.99), 1) + " / max "
+               + juce::String (v.back(), 1) + " ms";
+    }
+
+    void inject (float px, float py, bool down)
+    {
+        lastY = py;
+        if (auto* peer = window != nullptr ? window->getPeer() : nullptr)
+        {
+            const auto local = peer->globalToLocal (window->localPointToGlobal (juce::Point<float> (px, py)));
+            peer->handleMouseEvent (juce::MouseInputSource::InputSourceType::mouse, local,
+                                    down ? juce::ModifierKeys (juce::ModifierKeys::leftButtonModifier) : juce::ModifierKeys(),
+                                    juce::MouseInputSource::defaultPressure, juce::MouseInputSource::defaultOrientation,
+                                    juce::Time::currentTimeMillis());
+        }
+    }
+
+    void hiResTimerCallback() override
+    {
+        if (! active.load())
+            return;
+        if (posted.exchange (true))
+        {
+            ++dropped;
+            return;
+        }
+        const auto postedAt = juce::Time::getMillisecondCounterHiRes();
+        juce::MessageManager::callAsync ([self = shared_from_this(), postedAt] {
+            self->posted = false;
+            if (! self->active.load())
+                return;
+            const auto now = juce::Time::getMillisecondCounterHiRes();
+            self->queueDelays.push_back (now - postedAt);
+            // up and down ~1.3 times a second, like the reporter's hand
+            const auto y = self->centreY + self->amplitude * (float) std::sin (2.0 * juce::MathConstants<double>::pi * 1.3 * (now - self->t0) / 1000.0);
+            self->inject (self->x, y, true);
+            self->pending.push_back (postedAt);
+            ++self->moves;
+        });
+    }
+};
+
 class LynxApplication final : public juce::JUCEApplication
 {
 public:
@@ -4499,6 +4629,7 @@ private:
             std::function<void()> setup;
             std::function<void (int)> action; // per frame; none: the step watches the window for `frames` ms
             int frames;
+            std::function<juce::String()> finish = {}; // round 173f: after the step, its own lines for the report
         };
 
         struct UiPerf final : juce::Timer
@@ -4510,8 +4641,12 @@ private:
             std::size_t step = 0;
             int frame = -1;
             std::vector<double> times, rendered; // whole frames (event + paint + blit, when this timer paints) / the window's paints
+            std::vector<double> frames;          // round 173f: the time of every frame the window painted (ui/FrameProbe.h)
             double setupMs = 0.0, wallStart = 0.0;
             double cpuStart = 0.0; // process CPU seconds (std::clock is wall time on Windows)
+            double messageCpuStart = 0.0; // the message thread's CPU seconds
+            double audioLoadSum = 0.0;    // the device's CPU use (AudioDeviceManager::getCpuUsage), summed per tick
+            int audioLoadTicks = 0;
 
             UiPerf (LynxApplication& a, juce::File r) : app (a), report (std::move (r)) {}
 
@@ -4543,11 +4678,17 @@ private:
                     setupMs = juce::Time::getMillisecondCounterHiRes() - t0;
                     times.clear();
                     rendered.clear();
+                    frames.clear();
                     wallStart = juce::Time::getMillisecondCounterHiRes();
                     cpuStart = lynx::processCpuSeconds();
+                    messageCpuStart = lynx::threadCpuSeconds();
+                    audioLoadSum = 0.0;
+                    audioLoadTicks = 0;
                     frame = 0;
                     return;
                 }
+                audioLoadSum += app.engine->getDeviceManager().getCpuUsage();
+                ++audioLoadTicks;
                 if (s.action)
                     s.action (frame);
                 if (const auto ms = paintNow(); ms > 0.25) // (nothing to paint: not a frame)
@@ -4558,10 +4699,16 @@ private:
 
                 const auto wall = juce::Time::getMillisecondCounterHiRes() - wallStart;
                 const auto cpu = 1000.0 * (lynx::processCpuSeconds() - cpuStart);
+                const auto messageCpu = 1000.0 * (lynx::threadCpuSeconds() - messageCpuStart);
                 text << s.name << ": show " << juce::String (setupMs, 1) << " ms\n"
                      << "    painted frames: " << stats (rendered) << "\n"
                      << "    timed here (event + paint + blit): " << stats (times)
-                     << "\n    CPU " << juce::String (wall > 0.0 ? 100.0 * cpu / wall : 0.0, 0) << "% (process, " << juce::String (wall / 1000.0, 1) << " s)\n";
+                     << "\n    window frames (probe): " << lynx::ui::FrameStats::of (frames, wall).describe()
+                     << "\n    CPU " << juce::String (wall > 0.0 ? 100.0 * cpu / wall : 0.0, 0) << "% (process, " << juce::String (wall / 1000.0, 1) << " s), message thread "
+                     << juce::String (wall > 0.0 ? 100.0 * messageCpu / wall : 0.0, 1) << "%, audio device "
+                     << juce::String (audioLoadTicks > 0 ? 100.0 * audioLoadSum / audioLoadTicks : 0.0, 1) << "%\n";
+                if (s.finish)
+                    text << s.finish();
                 juce::File (report).replaceWithText (text);
                 ++step;
                 frame = -1;
@@ -4591,6 +4738,7 @@ private:
                     juce::ignoreUnused (juce::Desktop::getInstance().getMainMouseSource().getScreenPosition());
                 text << "mouse position query: " << juce::String ((juce::Time::getMillisecondCounterHiRes() - q0) / 100.0, 3) << " ms\n";
                 app.mainWindow->onFrame = nullptr;
+                app.mainWindow->watchFrames ({});
                 app.engine->stop();
                 text << "result=OK\n";
                 report.replaceWithText (text);
@@ -4613,6 +4761,13 @@ private:
 
         auto run = std::make_unique<UiPerf> (*this, report);
         mainWindow->onFrame = [r = run.get()] (double ms) { if (r->frame >= 0) r->rendered.push_back (ms); };
+        // round 173f: every frame the window paints; a fader drag's moves count as shown when a frame covers the fader
+        auto drag = std::make_shared<UiPerfDrag>();
+        mainWindow->watchFrames ([r = run.get(), drag] (double now, juce::Rectangle<int> area) {
+            if (r->frame >= 0)
+                r->frames.push_back (now);
+            drag->framePainted (now, area);
+        });
         run->text << "project: " << project.getFullPathName() << "\n"
                    << "LYNX " << getApplicationVersion() << ", " << juce::SystemStats::getOperatingSystemName() << ", "
                    << juce::SystemStats::getCpuModel() << ", window " << mainWindow->getWidth() << "x" << mainWindow->getHeight()
@@ -4621,6 +4776,22 @@ private:
                    << ", audio device " << (engine->getDeviceManager().getCurrentAudioDevice() != nullptr ? engine->getDeviceManager().getCurrentAudioDevice()->getName() : juce::String ("none")) << "\n"
                    << "load " << juce::String (loadMs / 1000.0, 2) << " s\n";
         const auto none = juce::ModifierKeys();
+        // discussion #10 (round 173f): the reporter's screen — the Channel Rack and the Mixer open, the pattern playing —
+        // watched as it is, then insert 3's fader dragged up and down with the mouse (125 moves a second through the
+        // window's own mouse path, the frames painted as the window paints them)
+        const auto dragTrack = engine->getSong().mixer.size() > 3 ? 3 : 1;
+        run->steps.push_back ({ "rack + mixer, pattern playing", [this, ui] {
+                                   ui->showPanelsForSnapshot ({ lynx::workspace::Panel::channelRack, lynx::workspace::Panel::mixer });
+                                   engine->getTransport().songMode = false;
+                                   engine->rewind();
+                                   engine->play();
+                               }, {}, 4000 });
+        run->steps.push_back ({ "fader drag by mouse, rack + mixer, pattern playing", [this, ui, drag, dragTrack] {
+                                   auto& strips = ui->getMixerForSnapshot().getStripsForSnapshot();
+                                   const auto rail = strips.faderRailForSnapshot (dragTrack);
+                                   drag->start (*mainWindow, strips, rail, engine.get(), dragTrack);
+                               }, {}, 3000, [drag] { return drag->stop(); } });
+        run->steps.push_back ({ "after the drag (released)", {}, {}, 600, [drag] { return drag->released(); } });
         run->steps.push_back ({ "desktop, playing", [this, ui] { ui->showDesktopForSnapshot (false); engine->rewind(); engine->play(); }, {}, 3000 });
         run->steps.push_back ({ "mixer maximised, playing", [ui] { ui->selectTabForSnapshot (3); }, {}, 3000 });
         run->steps.push_back ({ "mixer scroll", {}, [wheelAt, ui, none] (int f) { wheelAt (ui->getMixerForSnapshot(), 0.0f, f < 30 ? -0.25f : 0.25f, none); }, 60 });
@@ -10032,6 +10203,8 @@ private:
         // Shows the window (built hidden while the splash screen is up).
         void reveal()
         {
+            if (lynx::uitrace::enabled()) // LYNX_TRACE_UI: the frames per second and the longest gap in ui.log (round 173f)
+                watchFrames ({});
             setVisible (true);
             lynx::applyWindowChrome (*this);
             lynx::fitWindowOnScreen (*this); // a size saved at another UI zoom still fits (round 163)
@@ -10058,6 +10231,30 @@ private:
 
         void closeButtonPressed() override { JUCEApplication::getInstance()->systemRequestedQuit(); }
 
+        // Every frame the window paints, with its dirty area (ui/FrameProbe.h; --uiperf, LYNX_TRACE_UI). The trace keeps
+        // counting when --uiperf watches too.
+        void watchFrames (std::function<void (double, juce::Rectangle<int>)> callback)
+        {
+            if (probe == nullptr)
+            {
+                probe = std::make_unique<lynx::ui::FrameProbe>();
+                Component::addAndMakeVisible (*probe); // (ResizableWindow hides the plain overload)
+                probe->setBounds (getLocalBounds());
+            }
+            probe->onFrame = [callback = std::move (callback)] (double now, juce::Rectangle<int> area) {
+                if (lynx::uitrace::enabled())
+                    lynx::uitrace::frame (now);
+                if (callback)
+                    callback (now, area);
+            };
+        }
+        void resized() override
+        {
+            DocumentWindow::resized();
+            if (probe != nullptr)
+                probe->setBounds (getLocalBounds());
+        }
+
         // --uiperf: the time of each frame the window paints (its own paint, then every child's, up to the last)
         std::function<void (double)> onFrame;
         void paint (juce::Graphics& g) override
@@ -10076,6 +10273,7 @@ private:
 
     private:
         lynx::MainComponent* content = nullptr; // owned by the window
+        std::unique_ptr<lynx::ui::FrameProbe> probe; // (on top of the content; see watchFrames)
         double frameStart = 0.0;
         bool maximiseOnReveal = false;
 

+ 75 - 0
src/ui/FrameProbe.h

@@ -0,0 +1,75 @@
+#pragma once
+
+// Frame timing probe (round 173f, discussion #10 "is the DAW fluid?"): a transparent component on top of the main
+// window that sees every frame the window paints. JUCE paints a window region by region and skips the paint() of a
+// component its opaque children cover, so the window's own paint() misses most frames (a meter or a fader repaints
+// only its rectangle); this probe covers the whole window, never draws and never takes the mouse, so its paint() runs
+// once per painted frame with that frame's dirty area as the clip.
+// Installed only by --uiperf and LYNX_TRACE_UI (ui.log then gets the frames per second and the longest gap).
+
+#include <juce_gui_basics/juce_gui_basics.h>
+
+#include <algorithm>
+#include <functional>
+#include <vector>
+
+namespace lynx::ui
+{
+class FrameProbe final : public juce::Component
+{
+public:
+    FrameProbe()
+    {
+        setInterceptsMouseClicks (false, false);
+        setWantsKeyboardFocus (false);
+        setOpaque (false);
+        setAlwaysOnTop (true);
+        setAccessible (false);
+    }
+
+    // message thread: the time of the frame (ms, Time::getMillisecondCounterHiRes) and the bounds of its dirty area
+    std::function<void (double, juce::Rectangle<int>)> onFrame;
+
+    void paint (juce::Graphics& g) override
+    {
+        if (onFrame)
+            onFrame (juce::Time::getMillisecondCounterHiRes(), g.getClipBounds());
+    }
+};
+
+// Frame times → the numbers a report prints: frames per second, the gaps between frames (p50 / p95 / p99 / max) and
+// how many gaps a user sees as a hitch (> 50 ms).
+struct FrameStats
+{
+    int frames = 0;
+    double fps = 0.0, p50 = 0.0, p95 = 0.0, p99 = 0.0, max = 0.0;
+    int hitches = 0;
+
+    static FrameStats of (const std::vector<double>& times, double spanMs)
+    {
+        FrameStats s;
+        s.frames = (int) times.size();
+        s.fps = spanMs > 0.0 ? 1000.0 * (double) times.size() / spanMs : 0.0;
+        std::vector<double> gaps;
+        for (std::size_t i = 1; i < times.size(); ++i)
+            gaps.push_back (times[i] - times[i - 1]);
+        if (gaps.empty())
+            return s;
+        std::sort (gaps.begin(), gaps.end());
+        const auto at = [&gaps] (double q) { return gaps[std::min (gaps.size() - 1, (std::size_t) (q * (double) gaps.size()))]; };
+        s.p50 = at (0.5);
+        s.p95 = at (0.95);
+        s.p99 = at (0.99);
+        s.max = gaps.back();
+        s.hitches = (int) std::count_if (gaps.begin(), gaps.end(), [] (double g) { return g > 50.0; });
+        return s;
+    }
+
+    juce::String describe() const
+    {
+        return juce::String (frames) + " frames, " + juce::String (fps, 1) + " fps, gap p50 " + juce::String (p50, 1) + " / p95 "
+               + juce::String (p95, 1) + " / p99 " + juce::String (p99, 1) + " / max " + juce::String (max, 1) + " ms, gaps > 50 ms "
+               + juce::String (hitches);
+    }
+};
+} // namespace lynx::ui

+ 8 - 0
src/ui/MainComponent.cpp

@@ -2406,6 +2406,14 @@ void MainComponent::showDesktopForSnapshot (bool extraPanels)
     refreshPanelButtons();
 }
 
+void MainComponent::showPanelsForSnapshot (std::initializer_list<Panel> panels)
+{
+    workspace.resetLayout();
+    for (const auto panel : panels)
+        workspace.show (panel);
+    refreshPanelButtons();
+}
+
 // --- patterns ------------------------------------------------------------------------------------
 
 void MainComponent::selectPattern (int index)

+ 2 - 0
src/ui/MainComponent.h

@@ -71,6 +71,8 @@ public:
     void togglePluginPickerForSnapshot() { togglePluginPicker(); }
     juce::Component* pluginPickerForSnapshot() const noexcept { return pluginPickerView.get(); }
     void showDesktopForSnapshot (bool extraPanels);
+    // --uiperf (round 173f): the default layout with these panels shown too (the reporter's Channel Rack + Mixer)
+    void showPanelsForSnapshot (std::initializer_list<workspace::Panel> panels);
     void openQuickAddForTest() { showQuickAdd(); } // --windowtest
     void waitForBrowserForSnapshot() { browser.waitForListing (5000); }
     juce::StringArray getMenuNamesForSnapshot() { return getMenuBarNames(); }

+ 2 - 0
src/ui/MixerComponent.h

@@ -174,6 +174,8 @@ public:
 
     void mouseMove (const juce::MouseEvent& e) override;
     void mouseExit (const juce::MouseEvent& e) override;
+    // --uiperf (round 173f): where a fader drag starts (the fader's rail, strip coordinates)
+    juce::Rectangle<int> faderRailForSnapshot (int track) const { return faderRail (track); }
 
 private:
     enum class Part { none, pan, stereo, fader, meter, mute, solo, route, send, header, body, add, arm, input };

+ 15 - 1
src/ui/UiTrace.h

@@ -29,6 +29,9 @@ struct State
     std::atomic<double> worstScopeMs { 0.0 };
     std::atomic<int> paints { 0 };
     std::atomic<double> worstStallMs { 0.0 };
+    std::atomic<int> frames { 0 };              // frames the main window painted (ui/FrameProbe.h, round 173f)
+    std::atomic<double> worstFrameGapMs { 0.0 }; // the longest time between two of them
+    double lastFrameMs = 0.0;                    // (message thread)
     juce::CriticalSection lock;
     juce::String worstScopeName, pending; // pending: log lines written by the watchdog thread
     std::function<juce::String()> summary;
@@ -40,6 +43,16 @@ inline State& state()
     return s;
 }
 
+// The main window painted a frame (message thread; ui/FrameProbe.h). Gaps over 1 s are idle time, not a hitch.
+inline void frame (double nowMs)
+{
+    auto& s = state();
+    s.frames.fetch_add (1, std::memory_order_relaxed);
+    if (const auto gap = nowMs - s.lastFrameMs; s.lastFrameMs > 0.0 && gap < 1000.0 && gap > s.worstFrameGapMs.load (std::memory_order_relaxed))
+        s.worstFrameGapMs.store (gap, std::memory_order_relaxed);
+    s.lastFrameMs = nowMs;
+}
+
 // Scopes slower than this are logged (LYNX_TRACE_UI_MIN=<ms>, default 8)
 inline double logThresholdMs()
 {
@@ -221,7 +234,8 @@ private:
                     name = s.worstScopeName;
                     s.worstScopeName = {};
                 }
-                append ("second: worst stall " + juce::String (secondWorst, 1) + " ms, paints " + juce::String (s.paints.exchange (0))
+                append ("second: worst stall " + juce::String (secondWorst, 1) + " ms, frames " + juce::String (s.frames.exchange (0))
+                        + " (longest gap " + juce::String (s.worstFrameGapMs.exchange (0.0), 1) + " ms), paints " + juce::String (s.paints.exchange (0))
                         + ", slowest scope " + juce::String (s.worstScopeMs.exchange (0.0), 1) + " ms " + name + "  " + audio);
                 lastSummary = now;
                 juce::String text;

+ 15 - 0
src/ui/WindowOwner.cpp

@@ -86,6 +86,21 @@ double processCpuSeconds()
    #endif
 }
 
+double threadCpuSeconds()
+{
+   #if JUCE_WINDOWS
+    FILETIME created {}, exited {}, kernel {}, user {};
+    if (GetThreadTimes (GetCurrentThread(), &created, &exited, &kernel, &user))
+        return (double) ((((std::uint64_t) kernel.dwHighDateTime << 32) | kernel.dwLowDateTime) + (((std::uint64_t) user.dwHighDateTime << 32) | user.dwLowDateTime)) * 1e-7;
+    return 0.0;
+   #elif defined (CLOCK_THREAD_CPUTIME_ID)
+    timespec t {};
+    return clock_gettime (CLOCK_THREAD_CPUTIME_ID, &t) == 0 ? (double) t.tv_sec + (double) t.tv_nsec * 1e-9 : 0.0;
+   #else
+    return 0.0;
+   #endif
+}
+
 juce::TextEditor* firstTextField (juce::Component& dialog)
 {
     juce::TextEditor* best = nullptr;

+ 2 - 0
src/ui/WindowOwner.h

@@ -81,4 +81,6 @@ juce::Image logoImage();
 
 // The CPU time this process has used so far, in seconds (user + kernel; --editorcpu).
 double processCpuSeconds();
+// The CPU time the calling thread has used so far, in seconds (user + kernel; --uiperf: the message thread's share).
+double threadCpuSeconds();
 } // namespace lynx