• Welcome to SpeedSolving.com — the world’s largest puzzle community!

    You’re currently browsing as a guest, which means you have limited access to discussions, resources, member profiles, and community features.

    Join 50,000+ cubers and puzzle enthusiasts from around the world to ask questions, share solves, improve faster, and be part of the community.

    Registration is free, fast, and easy — create your account today.

    Already a member? Log in here to hide this message and start participating.

.net code for a timer?

Zarxrax

Veteran
Joined
Jan 7, 2009
Messages
1,282
Location
North Carolina
I was wondering if anyone has implemented a timer in .net and has some code that they could share?
I've done it, but my implementation seemed to have a lot of lag and it felt like it wasn't very accurate.
I will possibly be writing a PLL training app similar to badmephisto's, but I need to get the timer part figured out before anything else.
 
C#.
They all use the same framework though, so if its written in any of the supported languages I could probably figure out how to port it to c#.
 
just because the microsoft compilers compile it to language the framework can understand does not mean the languages are similar. VB code is going to be quite different from C# code for the same tasks.

anyway, check the System.DateTime class. It has what you need. For a good idea of what to do for a timer, look through the qqTimer code to understand what's going on.
 
I think it would be pretty cool to make it in silverlight. Then it could port to several app types including windows phone.

But yea, saying .Net isn't very descriptive. The framework can be used for a variety of application types.
 
I don't remember exactly, I can check tomorrow though. .Net provides thousands of different functions though, and there are several which are designed for "timing" something. With so many options, its almost impossible to know which ones are most appropriate, sometimes.
 
Actually, it seems I was using a Timer and a Stopwatch.

In any case, that implementation turned out feeling very laggy, so I didn't like it much.

System.DateTime feels much more accurate, and it let me write the timer with MUCH fewer lines of code.
However, I'm now stuck at figuring out how to get it to display the elapsed time while the timer is running.
 
I wrote the WinMo timer in C#. I would be more than happy to share the code with you. It certainly is not "optimized" but it is very functional. The .net compact framework is more restrictive however, so you have many more options available than I did. My only real option was comparing tickcounts.
 
Silverlight is cool because it's portable? You're funny!

Silverlight isn't the best option for portability across operating systems or devices, I agree.

But when the TS is already developing in .NET, Silverlight isn't a bad option for this purpose at all. It CAN run on Windows, Mac and Linux as local apps, browser apps or server apps. and it runs on some other devices (like some phones) as well. Not "write once, run everywhere" but not "1 version of 1 OS on pc only" either.

The framework, development tools and languages that can be used with Silverlight are very good and there are free versions available. Installed base for the runtime is small though. Basically Silverlight is great for developers, not so great on the end-users point (yet?)
 
Well, I've got everything finished now except, um... displaying the data.
I was planning to use a listview, but then I found out that you cant really edit the items... so that doesn't work.

I wanna display about 4 different times for each PLL, and not really sure which form controls would be best for this. I'm not really fond of doing 100+ labels.
 
Back
Top