Skip to content

InWithTheNew/goroutines_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Go Routines Example

This very, very simple app is just an attempt at showing the power of go routines / concurrent processing.

It calls 2 funcs, DoBigQuery() and DoBigQueryInARoutine()

As you'll see, it runs DoBigQuery() only 20 times, and DoBigQueryInARoutine() 50,000 times. They both call DoComplicatedComputeThingy() for the number that's passed into it.

DoComplicatedComputeThingy() simulated some kind of compute / transaction that'll take .2 seconds.

How to run

Clone the repo, ensure you've got go installed. cd into the directory and run go run .

The output will be all of the calculations it's run from DoComplicatedComputeThingy() and then print the total time for sQ (serial query (no go routines)), and cQ (concurrent query (go routines)).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages