Skip to content

Instantly share code, notes, and snippets.

View GoaLitiuM's full-sized avatar

Ari Vuollet GoaLitiuM

  • Finland
  • 17:40 (UTC +03:00)
View GitHub Profile
@GoaLitiuM
GoaLitiuM / install_dmd.ps1
Created September 11, 2018 17:14
DMD install script for Windows
Set-StrictMode -Version latest
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
# default installation directory
$dmd_install = "C:\D"
echo "Fetching latest DMD version..."
$dmd_version = [System.Text.Encoding]::ASCII.GetString((Invoke-WebRequest -URI "http://downloads.dlang.org/releases/LATEST").content)
$dmd_url = "http://downloads.dlang.org/releases/2.x/$dmd_version/dmd.$dmd_version.windows.zip"
@GoaLitiuM
GoaLitiuM / TestSineSpeedD.d
Last active September 9, 2018 22:33
DSP Performance Test (D)
// C++ version ported to D from https://github.com/schmid/Unity-DSP-Performance-Test
module TestSineSpeedD;
import std.stdio;
import core.stdc.stdlib;
import std.algorithm;
static import std.math;
import std.math : PI;
@GoaLitiuM
GoaLitiuM / Usleep.cs
Created February 25, 2016 20:50
Usleep() for Windows (C#) + set timer resolution to lowest possible supported by system
using System;
using System.Runtime.InteropServices;
public static class Utility
{
static int ntCurrentResolution = 0;
public static void Usleep(ulong time)
{
if (ntCurrentResolution == 0)
NtSetTimerResolution(1, true, out ntCurrentResolution);
@GoaLitiuM
GoaLitiuM / test_usleep.cpp
Created February 25, 2016 20:43
usleep() for Windows (C/C++) + set timer resolution to lowest possible supported by system
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <stdio.h>
#include "usleep.h"
int main()
{
// not actually needed when calling usleep
setHighestTimerResolution(1);