This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#include <stdio.h> | |
#include "usleep.h" | |
int main() | |
{ | |
// not actually needed when calling usleep | |
setHighestTimerResolution(1); |