P
Phillip Taylor
This doesn't work:
Dim t As DateTime = DateTime.Now
Dim a As Long = t.Ticks
Dim t2 As DateTime = t.AddSeconds(1)
Dim b As Long = t2.Ticks
Dim ans As Long = b - a
sets ans to 0 instead of 1 million. You have to do this:
Dim t As DateTime = DateTime.Now
Dim a As Long = t.Ticks
Dim t2 As DateTime = t.AddSeconds(1)
Dim b As Long = t2.Ticks
Dim ans As Long = (DirectCast(b, Long) - DirectCast(a, Long))
to get around it. Although is there a more elegant way?
Phill
Dim t As DateTime = DateTime.Now
Dim a As Long = t.Ticks
Dim t2 As DateTime = t.AddSeconds(1)
Dim b As Long = t2.Ticks
Dim ans As Long = b - a
sets ans to 0 instead of 1 million. You have to do this:
Dim t As DateTime = DateTime.Now
Dim a As Long = t.Ticks
Dim t2 As DateTime = t.AddSeconds(1)
Dim b As Long = t2.Ticks
Dim ans As Long = (DirectCast(b, Long) - DirectCast(a, Long))
to get around it. Although is there a more elegant way?
Phill