Timing code within functions in Unity

I had to time some C# code within a function in Unity3D. Without the professional version of Unity, you don’t have a profiler. The code I used was the following:

long startTime = DateTime.UtcNow.Ticks;

// some code you want to time

long now = DateTime.UtcNow.Ticks;
long tm1 = now - startTime;
startTime = now;

// more code you want to time

now = DateTime.UtcNow.Ticks;
long tm2 = now - startTime;
startTime = now;

// etc
Debug.Log("tm1 = " + tm1);
Debug.Log("tm2 = " + tm2);

This worked for me and enable me to determine which part of the code was taking the time (not the part that I was expecting!).

There may be better ways to do this, but this worked for me.

The first home-made wine…

… that Helen has liked. She actually said that she loved it!

Most of my previous attempts at wine have tasted like feet. And not in a good way. This wine is a little sweet. It does not have the oaky depth of a heavy red, but tastes like a lighter, flavorful red or a rich rose.

I made this wine with Dimes grape juice and mashed up raisins to add body. I started fermenting it on the 4th November 2015, and it was bottled on the 6th February 2016 – over 3 years ago!

Internet Fast

For the last few days I have been on an Internet fast. That means no news, no Twitter, no surfing, no games, no Netflix. I still check my email, and I send and receive the occasional WhatsApp message, but that’s about it.

I feel so much more productive! When I would normally reach for my phone to check twitter, or read the news, I have been studying, or doing something active. When I go back to accessing the Internet again, I will probably try and limit myself to certain times of the day.

Back from France

On Wednesday we arrived back from France. We spent a week walking the first part of the Robert Louis Stevenson track (or the GR-70) as it’s known by on the maps. We started off by spending a couple of days in Paris, staying at the Marriott Courtyard near the Gare de Lyon station. We had a fantastic view over Paris – including the Eiffal Tower!

On Friday 29th March, we took the train down to Le Puy en Velay, which is a picturesque town which most people use as the start of le Stevenson” (as the walk is known as in France). We stayed at a lovely 15th century place, which was an old alchemist’s house.

From Le Puy we walked to Le Monastier-sur-Gazeille. We stayed at a pretty little B&B there, where we had our own little separate apartment with a pellet stove!

From Le Monastier we walked to Goudet, and stayed at the only hotel in town. It is a basic hotel, but servicable, and we chatted to the locals there. They had just opened the hotel – it stays closed for 6 months over the winter.

From Goudet we had a very long walk to Pradelles. The hotel we were booked into at Pradelles was cancelled the day we were due to arrive, so we ended up having to stay at gites – a small holiday home.

After Pradelles, we caught a ride to the train station at Langogne, then from there a bus to Ales and finally a train to Nimes. The next morning was an extremely cheap Ryanair flight back to London.

It was a lovely trip and we had a great time.