MXIi

making sense of things

Ways to measure execution time in PowerShell

Ok, back to business. No electronics at least for a few posts though.

It will be clear later why I became interested in this topic. But it is, on its’ own, worth for a post, so here it is.

Measure-Command

The canonical way to measure how long something runs in PowerShell is to use Measure-Command cmdlet.

> Measure-Command { "do stuff" }


Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 0
Ticks             : 7436
TotalDays         : 8,60648148148148E-09
TotalHours        : 2,06555555555556E-07
TotalMinutes      : 1,23933333333333E-05
TotalSeconds      : 0,0007436
TotalMilliseconds : 0,7436

One notable downside of this is that you see no output from a command. Time span is returned instead.

What else can we do?

Circling the square

I have some more Paint.NET shapes added to collection. Superellipses to be precise. Check the project page.

Superellipse or Lamé curve is the shape produced by generalized equation of ellipse, where we change the power factor. It approaches to rectangular shape on large values.

Also check the video below for a little bit of history of this shape in design.

Released some shapes for Paint.NET and converter

Some glitch-art, for starters. Guess what it was supposed to be:

guess what

Recently I was doing some simple photo-editing and found that it will be much easier if there were some crop masks. 3x3 grid and things like that.

After looking into Paint.NET forum I discovered that Paint.NET has support for custom shapes. This feature meet my needs almost perfectly.

I think I’ve overdid it a bit, and after some research and coding I end up with a bunch of stuff which you can see on a project page.

Decision between various blog engines

Ok, now this site is officially live. Time to write something. I’ll start from some details about site itself.

Initial idea was (long time ago) to use PmWiki as the site engine. I’ve used it before and I really like it. The main drawback that was bothering me - the complexity of maintaining blog-like site on a wiki engine. It is possible, but there are better ways to do it.

Then I discovered static site generators. There is not much conceptual difference between them and file-based wiki engines like PmWiki - bunch of text files translated into html pages with some rules, but on publishing time, rather than each time on site access. And it’s perfectly fine this kind of site. There even should be a way to use PmWiki as static site generator, if I remember correctly.

Looking for static site frameworks, I quickly discovered that there is a plenty of them. And there is a good choice of programming languages they are implemented in. As it was with PmWiki some time ago, I need to compare them and decide on optimal choice.

Hello world

This is just a placeholder post.

Posts will start appearing here later. You can subscribe to RSS if you don’t want to miss that moment.