$ vmstat -n 2 | perl -e 'while(<>){print localtime().": $_"}'
Fri Dec 30 15:34:51 2016: procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
Fri Dec 30 15:34:51 2016: r b swpd free buff cache si so bi bo in cs us sy id wa
Fri Dec 30 15:34:51 2016: 2 0 57216 94916 93012 135552 4 22 601 39 216 593 2 2 94 2
Fri Dec 30 15:34:53 2016: 0 0 57216 94296 93012 135552 0 0 0 0 201 737 1 1 98 0
Fri Dec 30 15:34:55 2016: 0 0 57216 94296 93012 135552 0 0 0 0 176 707 1 1 98 0
Fri Dec 30 15:34:57 2016: 0 0 57216 94296 93012 135552 0 0 0 0 174 656 1 1 98 0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <random> | |
#include <unordered_map> | |
#include <sstream> | |
#include <time.h> | |
#include <sys/time.h> | |
#include <openssl/md5.h> | |
#include <openssl/sha.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <time.h> | |
#include <sys/time.h> | |
typedef int TYPE; | |
typedef unsigned int UINT; | |
double print_time(struct timeval *s, struct timeval *e){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"os" | |
"sort" | |
"strconv" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <time.h> | |
#include <sys/time.h> | |
using namespace std; | |
typedef int TYPE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <time.h> | |
#include <sys/time.h> | |
typedef double TYPE; | |
typedef unsigned int UINT; | |
int cmp(const void*a, const void*b){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <sys/time.h> | |
//typedef int TYPE; | |
typedef long TYPE; | |
double print_time(struct timeval *s, struct timeval *e){ | |
int si = (s->tv_sec%1000000)*1000+s->tv_usec/1000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <sys/time.h> | |
double print_time(struct timeval *s, struct timeval *e){ | |
int si = (s->tv_sec%1000000)*1000+s->tv_usec/1000; | |
int ei = (e->tv_sec%1000000)*1000+e->tv_usec/1000; | |
return (double)(ei-si)/1000.0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <sys/time.h> | |
#include <pthread.h> | |
#include <errno.h> | |
unsigned long mem_size; | |
unsigned int malloc_cnt; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
#include <sys/time.h> | |
void print(int* a, int n){ | |
int i=0; | |
printf("["); | |
for(i=0;i<n;i++){ |