Skip to content

Instantly share code, notes, and snippets.

View gchavez2's full-sized avatar

gustavo gchavez2

View GitHub Profile
@gchavez2
gchavez2 / testTimer.cpp
Created October 30, 2017 23:55
Chrono timers C++11
// g++ -std=c++11 testTimer.cpp -o testTimer.out
// ./testTimer.out
#include <iostream>
#include <chrono>
#include <ctime>
long fibonacci(unsigned n)
{
if (n < 2) return n;
@gchavez2
gchavez2 / Papi memory counters
Last active October 30, 2017 23:57
Papi memory counters
We couldn’t find that file to show.
@gchavez2
gchavez2 / cut_mp3.py
Created July 3, 2016 12:28
Cut mp3 file with Python and pydub
# https://github.com/jiaaro/pydub
from pydub import AudioSegment
files_path = ''
file_name = ''
startMin = 9
startSec = 50
@gchavez2
gchavez2 / c_papi.c
Last active August 29, 2015 14:19
Necessary additions to C file to get access to performance counters
#include <papi.h>
#define NUM_EVENTS 1
int main ( int argc, char ** argv ) {
int Events[NUM_EVENTS] = {PAPI_TLB_DM}; //Data TLB misses
<your code>
PAPI_read_counters(values, NUM_EVENTS);