throughput

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package throughput provides functionality for producing content at an extremely high rate.

Example
package main

import (
	"os"

	"github.com/stevenxie/dgen/throughput"
)

func main() {
	const repstr = "test string "
	throughput.Dump(repstr, 3, throughput.RecommendedBufSize, os.Stdout)
}
Output:

test string test string test string

Index

Examples

Constants

View Source
const RecommendedBufSize = 1000

RecommendedBufSize is the buffer size recommended for Dump's bufsize argument.

It is roughly based on the speed of writing to os.Stdout. A different size should be considered for programs that do not write directly to the display.

Variables

This section is empty.

Functions

func Dump

func Dump(s string, repeats, bufsize int, out io.Writer) (n int, err error)

Dump repeats s, and streams the result to out.

Dump's bufsize argument indicates the maximum string size (in bytes) for which a buffering strategy should be used to reduce the frequency of writes to out.

To disable buffering entirely, set bufsize to 0.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL