Results 1 to 3 of 3

Thread: memory used

  1. #1
    Guest
    Is there a way to find out how much memory a VB project uses when it is executed? (and the time taken for certain commands without using the timer control to execute as well?)

    Sunny

  2. #2
    Junior Member
    Join Date
    Sep 2000
    Location
    Poland
    Posts
    26

    Smile

    Hi,
    which system do U use? In windows nt U can use task manager to see the usage of memory.
    As for the time taken by certain oprations... While writing and testing programs U can think of something like that

    sub ABC
    dim StartTime as Date
    dim EndTime as Date

    StartTime = Now

    'here are all the instructions U want to check their time

    EndTime = Now
    MsgBox "Start time: " & StartTime & vbCrLf & _
    "End time: " & EndTime & vbCrLf & vbCrLf & _
    EndTime - StartTime

    end sub

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    With Querryperformance you can determine the time it takes to execute something, with error diffusion upto 1 nanosecond.

    Code:
    Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
    Private Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
    
    Dim Start as currency, Finish as currency, Freq as currency
    
      QueryPerformanceCounter Start
      'your code you want to performance check
      QueryPerformanceCounter Finish
      QueryPerformanceFrequency Freq
      Msgbox CDbl(Finish - Start) * CDbl(Freq)*1000) & "microseconds"
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width