Click here to Skip to main content
15,914,905 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Editing subitems in Listview in VB.NET Pin
John Kuhn5-Feb-04 20:12
John Kuhn5-Feb-04 20:12 
GeneralHelp! clock generate Pin
jfk_lili5-Feb-04 15:46
jfk_lili5-Feb-04 15:46 
GeneralRe: Help! clock generate Pin
Roger Wright5-Feb-04 18:09
professionalRoger Wright5-Feb-04 18:09 
GeneralRe: Help! clock generate Pin
Dave Kreskowiak6-Feb-04 2:19
mveDave Kreskowiak6-Feb-04 2:19 
GeneralRe: Help! clock generate Pin
jfk_lili8-Feb-04 14:33
jfk_lili8-Feb-04 14:33 
GeneralRe: Help! clock generate Pin
Dave Kreskowiak9-Feb-04 4:50
mveDave Kreskowiak9-Feb-04 4:50 
GeneralRe: Help! clock generate Pin
jfk_lili9-Feb-04 22:15
jfk_lili9-Feb-04 22:15 
GeneralRe: Help! clock generate Pin
Dave Kreskowiak10-Feb-04 5:35
mveDave Kreskowiak10-Feb-04 5:35 
Well, when VB is executed, one statement in VB can equate to several statements in C. The problem your going to run into is that the time you require between pulses, MAY not be enough to execute the required statements to generate the pulses and track the time between them. You can use the program in my previous post to find out how long it takes your machine to execute just a simple assignment and a call to QueryPerformanceCounter.

Remember, you only have 0.0000025 seconds between pulses! Your going to need a bunch more statements to track the time between pulses with near continuous calls to QueryPerformanceCounter, fire an Out statement or some other event on Time (or really close to it!), AND let the system do other housekeeping work while you literally HOG the CPU generating this clock pulse so fast!

This is the ONLY high resolution timer that has (1) sub 1 millisecond resolution and (2) has an API call to it. Oh! and not all systems support this timer! Also, you can forget about capturing the CPU clock, it's WAY to fast and there is no way grab it.

A better test to see how fast your system will execute statements:
#include <windows.h>
#include <stdio.h>
#include <conio.h>
 
int main()
{
	BOOL			rc;
	int				iReturn;
	LARGE_INTEGER	liCountPerSecond, liStartTime, liEndTime, liCounts;
	double			dSeconds;
 
	rc = QueryPerformanceFrequency( &liCountPerSecond );
	printf( "Counts per second: %I64i\n", liCountPerSecond );
 
	rc = QueryPerformanceCounter( &liStartTime );
        // We are timing this section.
        // 10 simple assignment statements and an extra call
        // to QueryPerformanceCounter should make a crude, but
        // simple demonstration of performance.  This doesn't
        // include ANY error checking either!
	iReturn = 0;
	iReturn = 1;
	iReturn = 2;
	iReturn = 3;
	iReturn = 4;
	rc = QueryPerformanceCounter( &liEndTime );
	iReturn = 5;
	iReturn = 6;
	iReturn = 7;
	iReturn = 8;
	iReturn = 9;
	rc = QueryPerformanceCounter( &liEndTime );
        // End Timed Section.
 
	printf( "Start Time: %I64i\n", liStartTime );
	printf( "End Time  : %I64i\n", liEndTime );
 
	liCounts.QuadPart = liEndTime.QuadPart - liStartTime.QuadPart;
	printf( "Counts    : %I64i\n", liCounts );
 
	dSeconds = (double)liCounts.QuadPart / (double)liCountPerSecond.QuadPart;
	printf( "Time in Seconds : %15.10f seconds\n", dSeconds );
 
	getch();
}


RageInTheMachine9532
GeneralRe: Help! clock generate Pin
jfk_lili10-Feb-04 22:39
jfk_lili10-Feb-04 22:39 
GeneralProblem related to Cryptography API Pin
peterlck5-Feb-04 15:25
peterlck5-Feb-04 15:25 
GeneralRe: Problem related to Cryptography API Pin
Dave Kreskowiak6-Feb-04 2:26
mveDave Kreskowiak6-Feb-04 2:26 
GeneralRe: Problem related to Cryptography API Pin
Mike Dimmick6-Feb-04 3:29
Mike Dimmick6-Feb-04 3:29 
GeneralUsing MSCHART Pin
Zhaker5-Feb-04 15:14
Zhaker5-Feb-04 15:14 
GeneralRe: Using MSCHART Pin
Dave Kreskowiak6-Feb-04 2:28
mveDave Kreskowiak6-Feb-04 2:28 
GeneralRe: Using MSCHART Pin
Zhaker8-Feb-04 11:43
Zhaker8-Feb-04 11:43 
GeneralExcel OM Library - HELP I'm down! Pin
nvmoss5-Feb-04 12:01
nvmoss5-Feb-04 12:01 
GeneralIs there a customer control that can handle text and pictures Pin
Namboy825-Feb-04 6:32
Namboy825-Feb-04 6:32 
GeneralRe: Is there a customer control that can handle text and pictures Pin
John Kuhn5-Feb-04 10:33
John Kuhn5-Feb-04 10:33 
GeneralRe: Is there a customer control that can handle text and pictures Pin
Dave Kreskowiak5-Feb-04 11:03
mveDave Kreskowiak5-Feb-04 11:03 
GeneralHELP!!!!! on Forms Pin
Namboy825-Feb-04 6:26
Namboy825-Feb-04 6:26 
GeneralRe: HELP!!!!! on Forms Pin
John Kuhn5-Feb-04 10:16
John Kuhn5-Feb-04 10:16 
GeneralCOM Interop Attributes Pin
Jim Taylor5-Feb-04 5:45
Jim Taylor5-Feb-04 5:45 
GeneralRe: COM Interop Attributes Pin
Mike Dimmick6-Feb-04 3:34
Mike Dimmick6-Feb-04 3:34 
GeneralRe: COM Interop Attributes Pin
Jim Taylor6-Feb-04 3:47
Jim Taylor6-Feb-04 3:47 
Generalvb.net, timer, run program every 5 mins Pin
Chrissy Callen5-Feb-04 3:09
Chrissy Callen5-Feb-04 3:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.