sleep_sort

package module
v0.0.0-...-774ab9b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 3 Imported by: 0

README

睡眠排序(Sleep Sort)

注意:此项目只是一个玩笑性质的项目,请勿将其用于生产环境!

一、安装

go get -u github.com/golang-infrastructure/go-sleep-sort

二、示例代码

package main

import (
	"fmt"
	sleep_sort "github.com/golang-infrastructure/go-sleep-sort"
)

func main() {

	slice := []uint{8, 6, 9, 3}
	r := sleep_sort.SortUInt(slice)
	fmt.Println(r)
	// Output:
	// [3 6 8 9]

	slice = []uint{1000003, 1000010, 1000000}
	r = sleep_sort.SortUInt(slice)
	fmt.Println(r)
	// Output:
	// [1000000 1000003 1000010]

}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortTime

func SortTime(slice []time.Time) []time.Time

SortTime TODO 对时间排序

func SortUInt

func SortUInt[T gtypes.Unsigned](slice []T) []T

SortUInt 对无符号序列排序,通过休眠

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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