start new:
tmux
start new with session name:
tmux new -s myname
// sleepsort.js - Sort integers from the commandline in a very ridiculous way: leveraging timeouts :P | |
function sleepSort(array, callback) { | |
var sortedCount = 0, | |
i, len; | |
for ( i = 0, len = array.length; i < len; ++i ) { | |
setTimeout((function(j){ | |
return function() { | |
console.log(array[j]); | |
++sortedCount; |
{ | |
"APIGatewayServiceRolePolicy": { | |
"Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy", | |
"AttachmentCount": 0, | |
"CreateDate": "2019-10-22T18:22:01+00:00", | |
"DefaultVersionId": "v6", | |
"Document": { | |
"Statement": [ | |
{ | |
"Action": [ |
Operation | nanosec | microsec | millisec | notable | 1Bx |
---|---|---|---|---|---|
L1 cache reference | 0.5 ns |
0.5 s |
|||
Branch mispredict | 5 ns |
5 s |
|||
L2 cache reference | 7 ns |
14x L1 cache | 7 s |
||
Mutex lock/unlock | 25 ns |
25 s |
|||
Main memory reference | 100 ns |
20x L2 cache, 200x L1 cache | 1.6 m |
||
Compress 1K bytes with Zippy | 3,000 ns |
3 µs |
`5 |