Happy heavy lucky friendly. Happ ier than heav ier than luck ier than friendl ier than. The happ iest the heav iest the luck iest the friendl iest. Examples: Comparatives. Iron is heavier than wood. He is friendlier than his mother. She is prettier than her sister. Searching vs. Clicking: VCOG’s survey put a lot of weight on the number of clicks it took to get to a budget: 10 points for one click, 8 points for two clicks, and so on. The survey also gave credit, but not as much (4 points), when the budget came up in the first page of search results on the locality’s home page search function.
I want to get the clicks per second for a Button and save it in
_clicksPerSecond
.I already got how many clicks the user did:
So, if i click on the button, the counter for a click goes up one, that value will be saved in a
Highscore.txt
file:What i need is to count how many
_klicks
the user did in a second. But I don't know how to get the Time and how to get the value of _klicks
just for the second. For now i only get the _klicks
the user made all time. I'm using a WPF-Project for that.
Daniel KngDaniel Kng
2 Answers
You can use a timer that every 1000 milliseconds checks the value of _klicks, saves it in your file and sets it back to 0
This is if you do not need to record when the clicks happened, in that case use the suggestions in the comments.
nestedl00pnestedl00p
If you want an average, you should save the start time of the period over which you are averaging the clicks, so you can subtract it from the end time (which might be
DateTime.Now
).Then you can calculate the average thus:
This works because the DateTime subtraction operator returns a TimeSpan.
phoogphoog
Not the answer you're looking for? Browse other questions tagged c#wpf or ask your own question.
Hopefully this is in the right place..
Did as much of a search as it would allow me to do.
Example:
Click on link A, works.
back out to orig page
Click link B, goes to link A.
repeat back out, click on link B, goes to A.
Back out, just click anywhere in the window and not on a tab, goes to link A.
Right click, goes to link A.
Don't touch anything, goes to link A.
Mouse scroll, goes to link A.
Click within Windows desktop (windowed mode), windows desktop does not respond for multiple clicks, when finally does respond, former primary window border blinks many times and becomes primary window once again. Open another browser, in this case Maxthon, IE pops over and becomes primary window once again.
To add to the hell, if no internet windows are open and attempt to click on start button, multiple clicks required for access of hidden taskbar. Once start button is clicked, multiple clicks required to allow access to start menu and multiple clicks required per selection.
If IE or other browser is open and those are primary window, hidden taskbar is inaccessible unless multiple clicks to desktop or primary window is done.
Honestly, I have no idea what happened. I put the computer in sleep mode when not in use (I do shut down but not if I will be using shortly thereafter) and a few days ago this started happening. I tried system restore, no help. I just did sfc /scannow and nothing missing. I don't know what else to try. I'm not as tech savvy as everyone else but I can build my own system with no problems.
Google searched don't account to much but here's to hoping someone knows wtf is going on and can help.
Running Windows 7 Pro 64-bit
Did as much of a search as it would allow me to do.
Example:
Click on link A, works.
back out to orig page
Click link B, goes to link A.
repeat back out, click on link B, goes to A.
Back out, just click anywhere in the window and not on a tab, goes to link A.
Right click, goes to link A.
Don't touch anything, goes to link A.
Mouse scroll, goes to link A.
Click within Windows desktop (windowed mode), windows desktop does not respond for multiple clicks, when finally does respond, former primary window border blinks many times and becomes primary window once again. Open another browser, in this case Maxthon, IE pops over and becomes primary window once again.
To add to the hell, if no internet windows are open and attempt to click on start button, multiple clicks required for access of hidden taskbar. Once start button is clicked, multiple clicks required to allow access to start menu and multiple clicks required per selection.
If IE or other browser is open and those are primary window, hidden taskbar is inaccessible unless multiple clicks to desktop or primary window is done.
Honestly, I have no idea what happened. I put the computer in sleep mode when not in use (I do shut down but not if I will be using shortly thereafter) and a few days ago this started happening. I tried system restore, no help. I just did sfc /scannow and nothing missing. I don't know what else to try. I'm not as tech savvy as everyone else but I can build my own system with no problems.
Google searched don't account to much but here's to hoping someone knows wtf is going on and can help.
Running Windows 7 Pro 64-bit