summaryrefslogtreecommitdiffstats
path: root/svgbob/examples/demo.rs
blob: 999c60e20816b3b9a5c9f522772aaeb84ea45205 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate svg;
extern crate svgbob;

use std::time::Instant;
use svgbob::Grid;
use svgbob::Settings;

fn main() {
    let file = "examples/demo.svg";
    let t1 = Instant::now();
    let arg = include_str!("demo.bob");
    let g = Grid::from_str(arg, &Settings::default());
    let svg = g.get_svg();
    println!("took {}ms", t1.elapsed().as_millis());
    svg::save(file, &svg).unwrap();
    println!("Saved to {}", file);
}