All Projects → recp → tm

recp / tm

Licence: MIT license
timers and timeline

Programming Languages

c
50402 projects - #5 most used programming language
M4
1887 projects
shell
77523 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to tm

new-clock
The best clock app there is
Stars: ✭ 24 (-22.58%)
Mutual labels:  clock, timer, timer-clock
Use Timer
A timer hook for React
Stars: ✭ 113 (+264.52%)
Mutual labels:  time, clock, timer
React Timer Hook
React timer hook
Stars: ✭ 118 (+280.65%)
Mutual labels:  time, clock, timer
TimeContinuum
No description or website provided.
Stars: ✭ 28 (-9.68%)
Mutual labels:  time, clock
Timeline
AS2 & AS3 CPPS Emulator, written in Python. (Club Penguin Private Server Emulator)
Stars: ✭ 49 (+58.06%)
Mutual labels:  time, timeline
time
The simplest but configurable online clock
Stars: ✭ 77 (+148.39%)
Mutual labels:  time, clock
Node Measured
A Node metrics library for measuring and reporting application-level metrics, inspired by Coda Hale, Yammer Inc's Dropwizard Metrics Libraries
Stars: ✭ 500 (+1512.9%)
Mutual labels:  counter, timer
chronoman
Utility class to simplify use of timers created by setTimeout
Stars: ✭ 15 (-51.61%)
Mutual labels:  time, timer
telltime
iOS application to tell the time in the British way 🇬🇧⏰
Stars: ✭ 49 (+58.06%)
Mutual labels:  time, clock
hass-variables
Home Assistant variables component
Stars: ✭ 35 (+12.9%)
Mutual labels:  counter, timer
Clock
一个简单的计时器程序💡/A sample clock⏰
Stars: ✭ 15 (-51.61%)
Mutual labels:  clock, timer
ardusamber
Desamber time Arduino corporealization
Stars: ✭ 20 (-35.48%)
Mutual labels:  time, clock
React Native Countdown Component
React Native CountDown
Stars: ✭ 193 (+522.58%)
Mutual labels:  counter, timer
clocklet
An opinionated clock-style vanilla-js timepicker.
Stars: ✭ 31 (+0%)
Mutual labels:  time, clock
Dipstick
Configurable metrics toolkit for Rust applications
Stars: ✭ 92 (+196.77%)
Mutual labels:  counter, timer
vue-analog-clock-range
Vue Analog Clock Range Component
Stars: ✭ 53 (+70.97%)
Mutual labels:  time, clock
ios-application
A native, lightweight and secure one-time-password (OTP) client built for iOS; Raivo OTP!
Stars: ✭ 581 (+1774.19%)
Mutual labels:  counter, time
timestampy
🕒 Bunch of utilities useful when working with UNIX timestamps
Stars: ✭ 21 (-32.26%)
Mutual labels:  time, clock
simple-analog-clock
Simple clock view for displaying uh...time?
Stars: ✭ 24 (-22.58%)
Mutual labels:  time, clock
React Clock
An analog clock for your React app.
Stars: ✭ 149 (+380.65%)
Mutual labels:  time, clock

Timer and Timeline Utils for C

C/C++ CI MSBuild Codacy Badge

This library provides an easy way to set timers and timeouts. As initial version all timers run in single runloop at seperate thread. Currently only one thread is used for all timers, because there is only one runloop. In the future multiple runloop may be allowed.

Documentation

Currently all docs can be found in headers but in the future complete docs will be published.

Javascript and Swift/Objective-C like API

setTimeout in javascript is very useful and it is now in C:

tm_settimeout(callback, arg, delay);

TODOs:

  • Improve loopkup, make timers ordered. This may reduce some lookup operations runloop
  • Tests
  • More time and timeline utils
  • More platform support

Build

Unix (Autotools)

$ sh autogen.sh
$ ./configure
$ make
$ [sudo] make install

you can grap library in .libs folder after build finished

Windows (MSBuild)

Windows related build files, project files are located in win folder, make sure you are inside tm/win folder. Code Analysis are enabled, it may take awhile to build

$ cd win
$ .\build.bat

Example usage

#include <tm/tm.h>

/* callback */
void
mytimer(tm_timer *timer) {
  printf("my timer\n");
}

void
delayed_func(void *arg) {
  printf("settimeout: %s\n", (const char *)arg);
}

int 
main(int argc, const char * argv[]) {
  tm_timer   *timer1, *timer2, *timer3;
  tm_interval start, end, elapsed;
 
  /* option 1: alloc timer and start */
  timer1 = tm_alloc(mytimer, 1.5); /* 1.5 seconds */
  tm_start(timer1);
  
  /* option 2: alloc timer and start with delay */
  timer2 = tm_alloc(mytimer, 1.5); /* 1.5 seconds */
  tm_start_at(timer2, 0.05);       /* start after 0.05 secons */
  
  /* option 3: alloc timer and start with delay */
  timer3 = tm_schedule(mytimer, 1.5, 0.05); /* same as tm_alloc + tm_start_at */
  
  /* option 4: javascript-like setTimeout */
  tm_settimeout(delayed_func, "Hello World!", 0.00001);
  
  /*
  
  if we call free here timers will be stopped 
  
  tm_free(timer1);
  tm_free(timer2);
  tm_free(timer3);

  */
  
  /* measure elapsed time */
  start = tm_time();
  
  /* do stuff */
  
  end = tm_time();
  
  elapsed = end - start;
  
  /* wait timers to finish; otherwise main thread will cause timer thread to be exited */
  tm_wait();

  return 0;
}

License

MIT. check the LICENSE file

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].