Skip to content

Instantly share code, notes, and snippets.

@briandowns
Created August 24, 2019 16:44
Show Gist options
  • Save briandowns/80412a0abf948131470028e45881721c to your computer and use it in GitHub Desktop.
Save briandowns/80412a0abf948131470028e45881721c to your computer and use it in GitHub Desktop.
// https://github.com/briandowns/libspinner
// cc -o whatever -I/Users/bdowns/go/src/github.com/briandowns/libspinner
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include "libspinner.h"
int
main(int argc, char** argv)
{
spinner_t* s = spinner_new(19);
s->delay = 100000;
s->prefix = "Running ";
s->suffix = " I'm a suffix";
s->final_msg = "\nComplete!\n";
spinner_start(s);
sleep(5); // simulate some work
spinner_stop(s);
spinner_free(s);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment