Hi, not sure how this possible but a stopwatch set to 1000
and a timer set to go up 1 second are actually not perfectly in sync!
I know VB is horrible, but for this project it will work fine.
Here is the code and the .exe
Ignore some of the bits about key presses, not needed for now.
download:
https://mega.co.nz/#!RYB1zYbL!tNFtg9kWojt1ASKzKYjRj8uDPKe3JnlL1T6VQpvXA3Q
alt download
http://s000.tinyupload.com/index.php?file_id=95210156442717472759
and a timer set to go up 1 second are actually not perfectly in sync!
I know VB is horrible, but for this project it will work fine.
Here is the code and the .exe
Code:
Public Class Form1
Public hit2 As Boolean
Dim fg As Integer
Dim songtime As Double
Dim sw As New Stopwatch
Private Sub Form1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
'If Not e.Control Then Exit Sub
Select Case e.KeyCode
Case Keys.D : HitRight()
Case Keys.A : HitLeft()
End Select
End Sub
Public Sub HitRight()
LabelLeft.Text = sw.ElapsedMilliseconds
End Sub
Public Sub HitLeft()
'checknoteintegrity()
LabelLeft.Text = Format(songtime, "0.00")
End Sub
Private Sub Timer2_Tick_1(sender As Object, e As EventArgs) Handles Timer2.Tick
fg = fg + 1
LabelRight.Text = fg.ToString
LabelLeft.Text = sw.ElapsedMilliseconds
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer2.Start()
sw.Start()
Threading.Thread.Sleep(1000)
End Sub
End Class
download:
https://mega.co.nz/#!RYB1zYbL!tNFtg9kWojt1ASKzKYjRj8uDPKe3JnlL1T6VQpvXA3Q
alt download
http://s000.tinyupload.com/index.php?file_id=95210156442717472759