
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
High Precision/High Resolution Timer that can safely achieve 1ms callbacks
Using a Precision Timer
is as simple as using any other Windows Timer
using PrecisionTiming;
public static PrecisionTimer MyTimer = new PrecisionTimer();
Set Action
and Interval
and start the Precision Timer
MyTimer.SetInterval(SomeAction, Interval);
Check if the Precision Timer
is Running
MyTimer.IsRunning();
You can call SetInterval
again to change the Action
MyTimer.SetInterval(SomeDifferentAction, Interval);
Stop the Precision Timer
MyTimer.Stop();
Start the Precision Timer
Manually
MyTimer.Start();
Dispose the Precision Timer
MyTimer.Dispose();
If you use SetInterval
to set only Action
and Interval
the Precision Timer
will automatically start with the most common defaults, but it has several optional parameters you can change
For example, If you don't want the Precision Timer
to start automatically then use the following
MyTimer.SetInterval(SomeAction, Interval, false);
You can use Configure
instead of SetInterval
if you prefer
MyTimer.Configure(SomeAction, Interval, false);
You can manually configure the Precision Timer
and then Start
it yourself instead of using SetInterval
Sets the Action
that will be triggered by the TimerCallback
when the Period
has elapsed
MyTimer.SetAction(Action);
Periodic Timers
must stop before setting.
One Shot Timers
can change between shots, It is safer to stop.
Sets the Period (Interval) between Actions
in Milliseconds
.
MyTimer.SetPeriod(int);
MyTimer.GetPeriod();
Both Timer Modes
must stop before setting.
Set the Resolution
of the Precision Timer
before you start
MyTimer.Start(int);
The resolution is in milliseconds, The default resolution for SetInterval(Action)
is 0
The Resolution
increases with smaller values.
A resolution of 0 indicates periodic events should occur with the greatest possible accuracy.
To reduce system overhead, however, you should use the maximum value appropriate for your application.
The normal Resolution of a .Net Timer is around 12-15ms
Set EventArgs
of the Precision Timer
MyTimer.SetEventArgs(EventArgs);
MyTimer.GetEventArgs();
Periodic Timers
must stop before setting.
One Shot Timers
can change between shots, It is safer to stop.
Set the Periodic/OneShot Mode of the Precision Timer
MyTimer.SetAutoResetMode(bool);
MyTimer.GetAutoResetMode();
True
if the PrecisionTimer
should raise the Ticks
Event each time the interval elapses. (Periodic)
False
if the PrecisionTimer
should raise the event only once AFTER the first time the interval elapses. (One-Shot)
Both Timer Modes
must stop before setting.
FAQs
Unknown package
We found that precisiontimer.net demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.