Jump to content

New to Visual Basic

Samppa221
Go to solution Solved by manon_gfx,

I think you are asking how can format the time differently. 

If think you can use s.Elapsed.TotalMilliseconds.String to get the number of milliseconds.

I am not sure since the only VB programming I have done was a calculator and tic-tac-toe game in like 2008.

You should take a look at this MSDN page: https://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx

How do i use the Visual Basic stopwatch so it shows in ms.

 

I'm testing to do a simple pinging program. 

 

0a16bc74222f185ce99024367dbaef85.png

 

 

Now it shows it like this:

8c0137fd040a62f86f11be92dfdc22a7.png

Spoiler

CPU: i7-5820k @ 4.4GHz Motherboard: Asus X99 Strix  Graphics Card: Gigabyte 980Ti G1 Gaming Memory: Kingston HyperX Fury 24GB (3x 8GB) Hard Drive: 1TB WD Green SSD: Samsung 950 Pro 250GB CPU Cooling: Corsair H100i Power Supply: EVGA G2 850W Case: Corsair 400c Mouse: Logitech G502 Keyboard: Asus Strix (mx reds)  Monitor: BenQ XL2730Z 1440p@144hz OS: Windows 10 Professional 64-Bit Laptops: Lenovo Y50-70: i7-4720HQ - 16GB RAM - 256GB SSD - GTX 960m 4GB - MacBook Pro (Early 2016) 2,0GHz i5 - 8GB Ram - 256GB SSD Phone: iPhone 7+

 

Link to comment
Share on other sites

Link to post
Share on other sites

201406_1357_gfidb_sm.jpg

 

In all seriousness try looking at stackoverflow lots of help there

RyanTheCanadian

Network Administration / Systems Management and Security / White Hat

 

My computer is the definition of scrapyard wars.

 

Link to comment
Share on other sites

Link to post
Share on other sites

The StopWatch has an ElapsedMilliseconds attribute. Use that one instead of the simple Elapsed.

 

(I think , I've never used Visual Basic. Just looked at some documentation)

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

You could use a variable to contain the ping value, then use a function to extract only the ms count.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Good ole Visual Basic. I dont miss you in the slightest. @Sauron has a pretty solid idea. @Nineshadow i think your right. Im on mobile so I can't check.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

I think you are asking how can format the time differently. 

If think you can use s.Elapsed.TotalMilliseconds.String to get the number of milliseconds.

I am not sure since the only VB programming I have done was a calculator and tic-tac-toe game in like 2008.

You should take a look at this MSDN page: https://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx

Link to comment
Share on other sites

Link to post
Share on other sites

I think you are asking how can format the time differently. 

If think you can use s.Elapsed.TotalMilliseconds.String to get the number of milliseconds.

I am not sure since the only VB programming I have done was a calculator and tic-tac-toe game in like 2008.

You should take a look at this MSDN page: https://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx

Worked thanks!

 

28727467c585e6867e659edb0271790e.png

Spoiler

CPU: i7-5820k @ 4.4GHz Motherboard: Asus X99 Strix  Graphics Card: Gigabyte 980Ti G1 Gaming Memory: Kingston HyperX Fury 24GB (3x 8GB) Hard Drive: 1TB WD Green SSD: Samsung 950 Pro 250GB CPU Cooling: Corsair H100i Power Supply: EVGA G2 850W Case: Corsair 400c Mouse: Logitech G502 Keyboard: Asus Strix (mx reds)  Monitor: BenQ XL2730Z 1440p@144hz OS: Windows 10 Professional 64-Bit Laptops: Lenovo Y50-70: i7-4720HQ - 16GB RAM - 256GB SSD - GTX 960m 4GB - MacBook Pro (Early 2016) 2,0GHz i5 - 8GB Ram - 256GB SSD Phone: iPhone 7+

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×