Imports System.Windows.Forms Imports System.Drawing Module Module1 Sub Main() Dim pictureBox As New PictureBox() pictureBox.Dock = DockStyle.Fill Dim form As New Form() form.Controls.Add(pictureBox) form.Show() Dim bmp As New Bitmap(form.ClientSize.Width, form.ClientSize.Height) Dim g As Graphics = Graphics.FromImage(bmp) Dim timer As New System.Timers.Timer(1000) AddHandler timer.Elapsed, New System.Timers.ElapsedEventHandler(AddressOf timer_Elapsed) timer.Start() Dim nextFlame As Double = Environment.TickCount Dim wait As Single = 1000 / 60 While form.Created If Environment.TickCount >= nextFlame Then If Environment.TickCount < nextFlame + wait Then g.FillRectangle(Brushes.Black, 0, 0, pictureBox.Width, pictureBox.Height) For i As Integer = 1 To 4000 g.DrawString(fps.ToString(), form.Font, Brushes.White, i * form.Font.Size, i * form.Font.Size) Next pictureBox.Image = bmp drawCount += 1 End If nextFlame += wait End If Application.DoEvents() End While End Sub Dim fps As Integer = 0 Dim drawCount As Integer = 0 Sub timer_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) fps = drawCount drawCount = 0 End Sub End Module