I'm trying to run two processes concurrently.
One is a number cruncher, the other a "progress bar" that displays what percentage of the number cruncher is finished. Since the number cruncher provides nothing in the way of status I'm estimating the run time via other means and just printing a '+' and sleeping a calculated amount for the status. At the end of the progress bar function the number cruncher should be done - or nearly so. Anyway - in C or C++ this situation is usually resolved by flushing stdout. Is there a way to do that explicitly in GO? The os package doesn't seem to have anything appropriate listed under (*FIle) methods.
I'm open to other methods of doing this but so far this is pretty simple - at least in concept:// example: |++++++-------| shows about 50% percent estimated completion
go ProgressBar(200, 50) // task is expected to take 200 seconds, bar should be 50 characters wideresult, err := NumberCruncher()
runtime.GOMAXPROCS(runtime.NumCPU() + 1)