9 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Reverend Jim

##This project implements a multiple timer application. It was written in 1. Python 3.8.2 2. wxPython 4.1.0 Feel free to experiment. Here are some possible enhancements: 1. Add the ability to run a program when the timer expires. With a little scripting you could, for example, schedule the sending of …

2
1K
Member Avatar for sfuo

This is a timer class that I wrote a while ago (cleaned up a bit for the snippet) for adding delays in some of the games I have written over the years. Note: I normally have the class functions in a .cpp file but since it looks like I can …

Member Avatar for dexblack_1
0
12K
Member Avatar for Klahr_R

A simple timer for Excel VBA Excel VBA does not have a timer control. The alternative is to use the Timer() Function, and that leaves much to be desired. This code should be placed in a code module. My need was to tend to an abandoned program that was waiting …

Member Avatar for Bloodseeker
0
3K
Member Avatar for Diamonddrake

I needed a 5 minute countdown for a project I was working on so I hacked this up, It does nothing more and nothing less. Figured I would post it while I was here to save someone else the trouble. (Not that it's in anyway difficult to do.)

Member Avatar for kplcjl
1
3K
Member Avatar for deceptikon

No bells and whistles, just a quickie millisecond timer showing an alternative to the far less portable clock_t method. A test main() is included, just define TEST_DRIVER as a macro or remove the conditional compilation at the end.

Member Avatar for vijayan121
0
7K
Member Avatar for ddanbe

Start a new console application and fill in the about 70 lines of code in the Program.cs file. Run and enjoy!

Member Avatar for ddanbe
2
402
Member Avatar for TrustyTony

My not OO version of timer for work and pause time (but it does use attributes for functions, which are objects, to avoid global declarations in functions).

0
819
Member Avatar for TrustyTony

The code demonstrates running program limitted time by following going over endtime expressed in seconds since midnight, so might fail for playing just midnight (add check that endtime is less than 24*60*60 if you want to be sure). Exciting action :) of the program is that it shows remaining time …

0
443
Member Avatar for ddanbe

Start a new Forms application. Drop a Panel and a Timer control on it. Set up a Timer_Tick, Form_Load and a Panel_Paint eventhandler and fill in the code. Run the app and watch the string rotate.

Member Avatar for Diamonddrake
2
1K

The End.