Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
547 views

Clear output line in terminal after use for countdown (different length strings)

The method to overwrite the same line is well known and I use it for countdown, but what about when the next output string has a different size and will be generated by a single print? That's the ...
Digital Farmer's user avatar
4 votes
0 answers
97 views

Game clock with configurable rate

Edit: Licensed source can be found here. The intent behind this class is to allow different game systems to run at their own clock rate. The physics integration rate should not be connected to the ...
user avatar
5 votes
1 answer
4k views

Algorithm to find the number of years, months, days, etc between two dates

I've been working on this one for a while. Took me a while to figure out all the logic rules for dates and months. The goal of this method is to return the number of years, months, days, hours, ...
imdandman's user avatar
4 votes
2 answers
391 views

Sleep until specified time

It's sometimes useful to pause until a specified time (but inconvenient to use at or the like), so I wrote a tiny script to wait until a user-specified time point ...
Toby Speight's user avatar
  • 81.7k
3 votes
2 answers
147 views

React clock component

I'm new to React.js and this code came from 30 Days of React - Day 7. However the given code example wasn't working so I rewrote it myself. My biggest issue here is how to make the component work ...
Kapparino's user avatar
3 votes
1 answer
193 views

JavaScript flipping clock

Here are two simple classes - Digit class maintains digit behaviour - primarily flipping animations, and Clock class handles everything that is related to time data. I'm going to use this code for ...
abstractmind's user avatar
6 votes
1 answer
778 views

Clock that changes document background color

This is a timer based clock (using setInterval()) that changes the background color of the body based on the clock time hexadecimal values. I suspect that this code ...
jeff's user avatar
  • 161
5 votes
1 answer
6k views

Basic Countdown Timer

Below is a class,Countdown, that takes seconds as input from an entry, and starts counting down when the "Start" button is ...
Nae's user avatar
  • 407
4 votes
2 answers
1k views

Countdown timer for new year

Please help me improve my code. Note that it runs just fine. Especially with the way I use SFML, I need lots of guidance since I've just started learning how to use this library. I'm still learning C++...
alienCY's user avatar
  • 363
3 votes
4 answers
262 views

JavaScript clock

I am trying to build a clock. You can see the working code here. However, I feel like I can do much better in the JavaScript code. ...
Hello Universe's user avatar
2 votes
2 answers
125 views

Simple timer checking class

This is a simple class that runs a timer every 10 seconds to update the title with some information like how long the application has been up, depending on the datetime that is set in another class ...
user129967's user avatar
2 votes
3 answers
3k views

Script to activate an alarm at a time in the future

I am making a flashlight plugin for macOS. Here is the main code, plugin.py, the method results gets called first and is passed ...
user avatar
2 votes
1 answer
3k views

A clock implemented using Moment.js

This is a POC for a clock using moment.js, eventually I plan to recreate this in Raect.js. Any opimisations or a better way to do it? ...
Vipin Rai's user avatar
3 votes
0 answers
82 views

A version of the Pebble Big Time watch face that also displays the date [closed]

I'm seeking style pointers, bugs, memory leaks, incorrect usage etc. ...
Kevin's user avatar
  • 31
2 votes
1 answer
1k views

Running alarms in python

My code is designed to simply trigger alarms; it is not supposed to be used by anyone but me. ...
computergorl's user avatar
2 votes
2 answers
515 views

Countdown to multiple update times each day

I'm creating an update function to show my users when the next update will be available. I'm using the jQuery countdown plugin to show the time. What is a more efficient way to write this? ...
Rover's user avatar
  • 21
4 votes
1 answer
2k views

New year countdown

Here's some code I wrote quickly to get a nice millisecond countdown going. It displays the number of milliseconds until the new year in whatever timezone is next to be in 2015 are in in huge font, ...
bjb568's user avatar
  • 659
4 votes
1 answer
1k views

Sending an email every half hour if a certain condition is met

This will be called every minute from the background thread. If my unauthorizedCount and badRequestCount is not equal to zero, ...
arsenal's user avatar
  • 2,177
4 votes
1 answer
337 views

Inefficient Stopwatch - revised

This is my revised code of Stopwatch: ...
TheCoffeeCup's user avatar
  • 9,446
5 votes
1 answer
263 views

Inefficient Stopwatch

I have just finished a simple GUI stopwatch, but some of its code looks like it needs replacing. This is the code: Clock class (extends Thread): ...
TheCoffeeCup's user avatar
  • 9,446
7 votes
1 answer
10k views

Simple stop watch

I'd like my code to be solid and good. That's why I want someone a little more experienced to give me some feedback so I can improve. Here is the code for a simple stop watch that I created. I feel ...
user3641882's user avatar
5 votes
1 answer
211 views

qos method call using DateTime and Stopwatch

I need to limit method call to 80 times per second (for each connectionId). My initial version: ...
Oleg Vazhnev's user avatar
4 votes
1 answer
2k views

Outputting a countdown in a div

I got this code working with the jQuery Countdown Plugin to take a string input and output a countdown in a div. Is there a better way of implementing this? JSFiddler HTML ...
drybread's user avatar