how do i run a timer on a separate thread in visual basic so it doesn't lag? Answered
I am currently writing a program that records the mouses position over a 256x192 px box, then spits it out every 67ms in the form of dsgamemaker xds code which can be pasted into the project code, to make a sprite move on the exact same path as the mouse moved during the recording.
A problem i am having however is that the timer event i am using to move the cursor representative sprite ( which moves with the D-Pad up down left right), when i begin recording, the sprite moves very very slowly because the frame rate is so very slow. as a separate timer event from the recorder, it moves slow, but when all the code is as one entire timer, it moves at literally 3 pixels per second.
however this does not affect the generated sprite cut-scene.
Ive read that if i put this timer on a separate thread, that it will run independently from the other timer which will stop the lagging. but the problem is that i cannot find a single example online which shows how to do this, and the ones that do show, don't work.
does someone know how i can make the timer run on a different thread? or even a different core for that matter, so it doesnt lagg?
Im puzzled as to how other applications can do this, increasing a value one at a time, at such a high rate, when the timer event, will never do that. is there some other way to run looping code like a timer event?
Your help would be greatly appreciated.
ill post the application soon to show you exactly whats happening
also im running VB 2008 express