Tagged articles
Timer
55 articles · Page 1 of 1
This article implements four timer scenarios — countdown, stopwatch, Pomodoro, and alarm — in HarmonyOS ArkUI, explaining design choices like setInterval vs Date.now() for precision, state machines for phase transitions, and lifecycle cleanup to avoid memory leaks.
AlarmArkUICountdown
0 likes · 36 min read

This guide walks through systemd’s architecture, explains each unit type and key directives, and provides a step‑by‑step walkthrough for creating a secure, resource‑limited, production‑grade .service file, including best‑practice configurations for restart policies, logging, timers, socket activation, and security hardening.
LinuxResource LimitsTimer
0 likes · 39 min read

This comprehensive guide walks you through Systemd’s architecture, explains every Unit type and Service section, shows how to choose the right Service Type, configure restart policies, watchdogs, resource limits, security hardening, logging, Timers and Socket activation, and provides a complete production‑grade Service file template with deployment steps and a checklist.
LinuxResource LimitsService
0 likes · 41 min read

The article explains why System.currentTimeMillis() is unsuitable for measuring code execution duration, demonstrates its non‑monotonic behavior and potential for negative results, and shows that System.nanoTime() provides a reliable, high‑resolution, monotonic timer for accurate performance analysis.
JavaPerformance MeasurementSystem.currentTimeMillis
0 likes · 8 min read

This article explains why the built‑in systemd timer engine is a more reliable, observable, and feature‑rich replacement for traditional crontab, and provides a step‑by‑step guide to rewrite, configure, and manage your scheduled tasks on Linux.
OperationsTimerautomation
0 likes · 9 min read

This article explains the core principles of timers, compares heap‑based and timing‑wheel algorithms, analyzes Go's built‑in timer implementation versus C#'s approach, and provides practical optimization techniques for high‑concurrency, high‑precision scenarios.
C++GoHeap
0 likes · 10 min read

This article dives deep into iOS timing mechanisms, explaining how CADisplayLink synchronizes with the screen refresh, how NSTimer works, the role of RunLoop modes, common memory‑leak pitfalls, and practical code solutions for smooth animations and accurate frame‑rate handling across iOS versions.
CADisplayLinkNSTimerRunLoop
0 likes · 31 min read

This article presents a curated collection of nine high‑utility C code snippets for embedded development, covering a circular buffer, custom assertions, bit reversal, fixed‑point arithmetic, endianness conversion, bit masks, timer handling, binary search, and a simple bitset structure, each with concise explanations and ready‑to‑use implementations.
Fixed-PointTimerbinary search
0 likes · 6 min read

This article examines high‑concurrency C++ timer solutions, detailing the principles, advantages, and code examples of three implementations—red‑black tree, min‑heap, and time‑wheel—while comparing their performance, complexity, and suitable application scenarios for server‑side systems.
C++Timer
0 likes · 22 min read

This article explains why C++ timers are essential for asynchronous programming, presents three implementation approaches—including a simple thread‑chrono version, a Boost.Asio based timer, and a C++11 atomic/condition‑variable design—offers practical optimization tips such as precise intervals, thread‑pool reuse, efficient callbacks, and memory management, and demonstrates their impact with a network‑server case study comparing naïve and optimized solutions.
Asynchronous ProgrammingBoost.AsioC++
0 likes · 22 min read

The article explains why using Thread.sleep in a loop causes busy‑waiting and performance problems, and demonstrates several Java scheduling alternatives—including Timer/TimerTask, ScheduledExecutorService, wait/notify, and CompletableFuture—to efficiently check a flag at fixed intervals.
CompletableFutureConcurrencyJava
0 likes · 9 min read

This article explains how BuildContext and various closure patterns in Flutter can cause memory leaks, demonstrates typical leak scenarios with code examples, and provides practical strategies such as disposing listeners, nullifying references, and using WeakReference or Finalizer to ensure proper garbage collection.
AnimationControllerBuildContextDart
0 likes · 10 min read

This article compares three single‑node scheduling approaches in Spring Boot—Java's legacy Timer, the modern ScheduledExecutorService, and Spring's @Scheduled annotation—showing their implementations, execution characteristics, thread handling, error behavior, and when to prefer each solution.
@ScheduledJava ConcurrencyScheduledExecutorService
0 likes · 19 min read

This article explains the fundamentals and execution order of JavaScript's setTimeout and setInterval functions, discusses their parameters and return values, demonstrates why setTimeout is asynchronous, shows how to cancel timers, and provides a custom recursive setTimeout solution that mimics setInterval behavior.
JavaScriptTimerfrontend
0 likes · 12 min read

Go 1.23 introduces a garbage‑collectable, synchronous timer channel implementation that eliminates resource leaks and race conditions, requiring code changes such as replacing len‑checks with non‑blocking selects and offering GODEBUG flags for toggling the new behavior during testing and production.
ConcurrencyGoTimer
0 likes · 8 min read

This article explains the fundamentals of Python decorators, demonstrates how to leverage the standard library functools module—including wraps, partial, and lru_cache—to build advanced, flexible decorators, and provides concrete timer and partial-function examples with full source code.
LRU cacheTimerdecorators
0 likes · 6 min read

This article explains how to implement seamless, invisible token refresh for authentication systems, covering client‑side strategies using Axios interceptors and timers, server‑side gateway filters with Spring Boot, code examples for detecting token expiration, obtaining new tokens, and choosing between client and server approaches based on security and performance considerations.
AuthenticationAxiosJWT
0 likes · 23 min read

This article introduces the concept of scheduled tasks, outlines common use cases such as data backup, log cleanup, and performance monitoring, and provides detailed examples of implementing periodic jobs in Java using java.util.Timer, ScheduledExecutorService, Spring @Scheduled, and Quartz, as well as in Go using the time package, cron library, and gocron.
Timercronscheduled tasks
0 likes · 12 min read

This article surveys eleven Java‑based delayed‑task solutions—including DelayQueue, Timer, ScheduledThreadPoolExecutor, RocketMQ, RabbitMQ, Redis key‑expiration, Redisson, Netty’s HashedWheelTimer, Hutool SystemTimer, Quartz, and a simple polling loop—providing code demos, implementation principles, and practical pros and cons for each approach.
DelayQueueQuartzRabbitMQ
0 likes · 25 min read

The article walks through Go’s context package, explaining how Context objects enable cancellation and timeout control in concurrent workflows, detailing the implementations of emptyCtx, cancelCtx, timerCtx, and valueCtx, and providing concrete code examples and internal mechanics.
@ValueCancellationConcurrency
0 likes · 19 min read

This guide explains how Workerman's Timer runs functions or class methods at set intervals within the same process, showing examples of anonymous‑function timers and configuring timers to run only on specific worker processes.
BackendConcurrencyTimer
0 likes · 3 min read

This article explains PWM fundamentals, compares several output methods ranging from blocking loops to hardware timer generation, and provides complete STM32F1 example code—including macro definitions, timer configuration, output functions, and practical tips on pin mapping and precision.
PWMSTM32Timer
0 likes · 8 min read

This article explains the principles, usage, and internal mechanisms of CADisplayLink and NSTimer in iOS, compares their advantages and drawbacks, discusses common pitfalls such as retain cycles, explores RunLoop modes and sources, and provides code examples and solutions for reliable timer handling.
CADisplayLinkNSTimerRunLoop
0 likes · 24 min read

This article explains how to enable and use iOS Picture-in-Picture for both system and custom video players, create a timer‑based PiP view, and integrate PiP into an English listening app, while comparing two implementation approaches and offering performance tips.
AVKitCustomPlayerSWIFT
0 likes · 16 min read

This article explains why traditional crontab cannot meet second‑ or millisecond‑level scheduling requirements in PHP projects and demonstrates how to use Workerman and Swoole timers, including code examples for one‑time, recurring, and task‑based executions.
BackendSwooleTimer
0 likes · 6 min read

This article explains Python decorators by first reviewing functions as first‑class objects, then showing how to create simple timing decorators, extend them with *args/**kwargs, and build higher‑order decorators like a repeat‑n‑times wrapper, complete with practical code examples.
PythonTimerargs
0 likes · 9 min read

The article thoroughly examines Asio’s core mechanisms—its scheduler’s post handling, the strand’s lock‑based ordering, and the timer subsystem’s heap‑driven queues—detailing executor operations, multi‑threaded execution paths, platform‑specific timer schedulers, and the efficient C++ techniques that enable high‑performance asynchronous programming.
AsioC++Networking
0 likes · 38 min read

This article explains the concepts, use cases, and internal implementations of Java's Timer, DelayQueue, and ScheduledThreadPoolExecutor, compares their performance characteristics, and introduces the time‑wheel scheduling algorithm—including hierarchical wheels—to address scalability challenges in high‑volume timed‑task systems.
ConcurrencyDelayQueueJava
0 likes · 12 min read

This article explains why the author created the StopCoding IntelliJ plugin, provides step‑by‑step installation and usage instructions, and walks through the Java Swing and Timer‑based implementation details, enabling developers to prevent prolonged sitting and improve productivity.
IntelliJJavaProductivity
0 likes · 8 min read

The article explores why absolute‑precision periodic tasks are hard to achieve, compares Java Timer and ScheduledExecutorService with Linux kernel mechanisms such as DelayedWorkQueue, futex, pthread_cond_timedwait, and high‑resolution hrtimers, and explains the underlying data structures and timing‑wheel algorithms.
SchedulingTimerhigh precision
0 likes · 11 min read

This article investigates a deadlock between the Main Thread and the JavaScriptCore Heap Collector Thread on iOS 13, explains the underlying mutex and RunLoop interactions, reproduces the issue with CFTimer‑based timers, and proposes an AutoReleasePool‑wrapped solution along with best‑practice recommendations for JavaScriptCore usage.
RunLoopTimerdeadlock
0 likes · 17 min read

An in‑depth analysis reveals how a Main Thread and JavaScriptCore Heap Collector Thread can deadlock on iOS 13 due to RunLoop lock contention triggered by timer callbacks and AutoReleasePool memory reclamation, and provides a practical solution using scoped AutoReleasePool blocks to prevent the issue.
RunLoopTimerdeadlock
0 likes · 18 min read

This article compares Java's Timer and ScheduledExecutorService for scheduling tasks, explains their internal workings, demonstrates common pitfalls, and provides multiple code examples showing how to schedule one‑off, fixed‑rate, and fixed‑delay tasks using both Runnable and Callable.
ConcurrencyJavaScheduledExecutorService
0 likes · 8 min read

This article introduces Go's time package, explaining its core types such as Month, Weekday, Duration, Location, and Time, and demonstrates how to work with timers, tickers, and time parsing through clear examples and code snippets.
DATETIMEDurationGo
0 likes · 13 min read

StopCoding is an IntelliJ IDEA plugin designed to prevent coding fatigue by periodically displaying an unclosable reminder dialog with a countdown, and this guide explains how to install, configure, and develop the plugin using Java, Swing UI components, and the JDK Timer API.
IDEAIntelliJJava
0 likes · 8 min read


JD TechApr 16, 2021 · Backend Development
This article explains how to use java.util.Timer for one‑time and periodic task scheduling, covering constructors, instance methods, daemon‑thread behavior, handling past dates, negative delays, multiple tasks, and proper shutdown, with complete code examples and execution results.
BackendConcurrencyJava
0 likes · 24 min read

This article explains how Flink's DataStream API uses AggregateFunction and session windows, details the MergingWindowAssigner and MergingWindowSet implementations, and demonstrates timer registration and processing with KeyedProcessFunction, providing full code examples and internal workflow analysis.
AggregateFunctionFlinkKeyedProcessFunction
0 likes · 25 min read

This article demonstrates three practical ways to schedule Python web‑crawling tasks—using an infinite while loop, the Timer module, and the sched module—providing code snippets, usage tips, and considerations for handling multiple runs and resource constraints.
PythonSchedulingTimer
0 likes · 6 min read

StopCoding is an IntelliJ IDEA plugin designed to curb prolonged coding sessions by periodically displaying an unclosable reminder dialog with a countdown, and the article provides installation instructions, usage guide, and a detailed development tutorial covering plugin structure, Swing UI, timer implementation, and key Java code snippets.
IntelliJ IDEAJavaSwing
0 likes · 7 min read

This article introduces the StopCoding IntelliJ plugin, detailing its purpose to prevent coding fatigue, providing step‑by‑step installation and usage instructions, and walking through its simple Java‑based development, including Swing UI creation, timer logic, and code snippets for building a self‑discipline tool.
IntelliJJavaProductivity
0 likes · 7 min read

This article introduces StopCoding, an IntelliJ IDEA plugin that forces developers to take regular breaks by displaying an unclosable dialog with a countdown timer, and provides step‑by‑step installation, usage instructions, and a complete walkthrough of its Java‑based Swing and Timer implementation.
IntelliJ IDEAJavaProductivity
0 likes · 7 min read

This article introduces the motivation behind the StopCoding IntelliJ IDEA plugin, provides detailed installation and usage instructions, and walks through its development—including plugin structure, Swing dialog creation, timer implementation, and essential Java code—so developers can build their own productivity‑boosting tool.
IntelliJJavaSwing
0 likes · 7 min read

This article introduces StopCoding, an IntelliJ IDEA plugin designed to interrupt prolonged coding sessions by showing an unclosable reminder dialog, and provides step‑by‑step installation, usage instructions, and a detailed Java‑based development tutorial including Swing UI and Timer implementation.
Coding HealthIDEA PluginIntelliJ
0 likes · 7 min read

This article walks through creating a Java Swing‑based exam application that displays driving‑license questions, handles timing, records answers, calculates scores, and shows result icons, providing complete code snippets and UI design guidance.
Exam SystemGUIJava
0 likes · 9 min read

This article explains how Flink's Timer mechanism works, covering its usage in KeyedProcessFunction, the underlying TimerService and InternalTimerService implementations, the role of triggers, and the detailed code paths for processing‑time and event‑time timers, while highlighting performance considerations.
FlinkInternalTimerServiceKeyedProcessFunction
0 likes · 16 min read

This article explains several ways to implement scheduled tasks in Java, covering the simple Timer class, the more robust ScheduledExecutorService, Spring's @Scheduled annotation, and distributed solutions using Redis ZSet and key‑space notifications, with code examples and practical considerations.
Distributed SchedulingJavaScheduledExecutorService
0 likes · 16 min read

This guide compares four Java scheduling options—Timer, ScheduledExecutorService, Spring Task, and Quartz—showing how to implement each in Spring Boot, configure cron expressions, enable async execution, and choose the right tool for your needs.
Cron ExpressionsQuartzScheduledExecutorService
0 likes · 12 min read

This article provides a detailed guide to Swoole's millisecond‑precision timer API, covering the underlying epoll_wait/setitimer implementation, the static methods tick(), after(), clear() and additional utilities such as clearAll(), info(), list(), stats() and set(), with full syntax, usage examples and code snippets for both synchronous and asynchronous processes.
BackendPHPSwoole
0 likes · 5 min read

This article explores various strategies for controlling execution timing in Java backend services, comparing Thread.sleep, Timer, and Redis-based expiration techniques, and provides practical code examples and configuration steps for integrating Redis with Spring Boot to achieve reliable delayed processing.
JavaTimerdelay
0 likes · 10 min read

This article explains the three main iOS timer mechanisms—NSTimer, CADisplayLink, and GCD dispatch sources—detailing their creation methods, differences, common pitfalls such as RunLoop mode and thread issues, and practical solutions for accurate scheduling.
CADisplayLinkGCDNSTimer
0 likes · 14 min read

Learn how to use Python, wxpy, and a timer to automatically fetch a daily quote and send personalized good‑morning or good‑night messages to a WeChat contact, complete with code examples and deployment tips.
TimerWeChatautomation
0 likes · 5 min read

This article provides a thorough overview of Java task scheduling, covering the native Timer utility, the thread‑pool‑based ScheduledExecutorService, and the powerful Quartz framework, including their APIs, usage patterns, limitations, and integration with Spring for enterprise applications.
JavaQuartzScheduledExecutorService
0 likes · 8 min read


21CTODec 3, 2015 · Backend Development
This article details the overall architecture of an instant‑messaging client, covering protocol encapsulation, task flow, various timer implementations, state management, reconnection logic, login process, asynchronous handling, and local caching strategies for reliable communication.
State ManagementTimerarchitecture
0 likes · 15 min read


21CTOAug 12, 2015 · Backend Development
This article explains how to implement a pure‑PHP timer using CLI mode, the PCNTL extension, and SIGALRM signals, covering basic concepts, task storage structures, the Timer class implementation, example usage, and practical considerations for long‑running services.
SignalTimercli
0 likes · 9 min read

This article explains Linux kernel interrupt handling, top‑half and bottom‑half mechanisms, IRQ request/release, shared IRQs, disabling/enabling IRQs, tasklets, workqueues, softirqs, the timer API, and provides a complete character‑device driver example with a user‑space test program.
C++InterruptLinux
0 likes · 16 min read
